The code was written so that it assumes that disconnecting the last signal also removed the corresponding entry in the signal array. This lead e.g. to an index-out-of-bounds access in some cases. Signed-off-by: Uli Schlachter <psychon@znc.in>