From b7fd397eb4a7a17a671b29e818b63718ab618b63 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sun, 24 Oct 2021 12:19:27 +0200 Subject: Use GLib's new g_clear_signal_handler() function to simplify code --- cut-n-paste/toolbar-editor/egg-toolbar-editor.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cut-n-paste/toolbar-editor') diff --git a/cut-n-paste/toolbar-editor/egg-toolbar-editor.c b/cut-n-paste/toolbar-editor/egg-toolbar-editor.c index 551bbde3..cb07011f 100644 --- a/cut-n-paste/toolbar-editor/egg-toolbar-editor.c +++ b/cut-n-paste/toolbar-editor/egg-toolbar-editor.c @@ -149,6 +149,11 @@ egg_toolbar_editor_disconnect_model (EggToolbarEditor *t) { handler = priv->sig_handlers[i]; +#if GLIB_CHECK_VERSION(2,62,0) + if ((handler == 0) || !g_signal_handler_is_connected (model, handler)) + continue; + g_clear_signal_handler (&handler, model); +#else if (handler != 0) { if (g_signal_handler_is_connected (model, handler)) @@ -158,6 +163,7 @@ egg_toolbar_editor_disconnect_model (EggToolbarEditor *t) priv->sig_handlers[i] = 0; } +#endif } } -- cgit v1.2.1