How to disconnect a signal of Gtk?

daisy picture daisy · Nov 7, 2011 · Viewed 9.4k times · Source

Will signals automatically disconnect, when target object is destroyed? Without recording the signal id from g_signal_connect(), can I remove that signal?

Answer

ptomato picture ptomato · Nov 7, 2011

If you didn't save the signal handler ID, you can search for it using g_signal_handler_find() and disconnect it the usual way, or disconnect any signals that match certain criteria with g_signal_handlers_disconnect_matched() or g_signal_handlers_disconnect_by_func().