Search code examples
gtksignals

How to disconnect a signal of Gtk?


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


Solution

  • 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().