Handler *handler;
for (handler = hlist->handlers; handler; handler = handler->next)
- if (handler->sequential_number == handler_id ||
- (closure && handler->closure == closure))
+ if (closure ? (handler->closure == closure) : (handler->sequential_number == handler_id))
{
if (signal_id_p)
*signal_id_p = hlist->signal_id;
}
SIGNAL_UNLOCK ();
- remove_invalid_closure_notify (handler, instance);
g_closure_unref (handler->closure);
SIGNAL_LOCK ();
g_slice_free (Handler, handler);
{
handler->sequential_number = 0;
handler->block_count = 1;
+ remove_invalid_closure_notify (handler, instance);
handler_unref_R (signal_id, instance, handler);
}
else
SIGNAL_LOCK ();
handler = handler_lookup (instance, 0, closure, &signal_id);
- /* GClosure removes our notifier when we're done */
- handler->has_invalid_closure_notify = 0;
+ g_assert (handler->closure == closure);
+
+ handler->sequential_number = 0;
+ handler->block_count = 1;
handler_unref_R (signal_id, instance, handler);
SIGNAL_UNLOCK ();