The inputs of unused op amps must always be connected to a low impedance voltage source within the active region, and the op amp output should be set to a valid value.
Otherwise the amp may oscillate or create other problems with the circuit. See this application note.
But it is an comparator and as always it is not easy to figure out what to do.
From the TI datasheet:
All pins of any unused comparators should be tied to the negative supply.
But then i was reading:
The inputs of an LM339 quad or LM393 dual comparator are still active when they are connected to ground. A comparator usually oscillates when both inputs have the same voltage. So you do not want both inputs connected to ground.
Connect the (-) input to ground and connect the (+) input to a positive voltage to set the output high (no current at the output).