diff options
author | rbuj <[email protected]> | 2021-10-24 12:19:27 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-01-09 14:24:00 +0100 |
commit | b7fd397eb4a7a17a671b29e818b63718ab618b63 (patch) | |
tree | 1fb37aeff930bf1a185ead5e3e196d72286e17fc /cut-n-paste | |
parent | e25ac2b7fe574063881d12beadc7fc6b52ad0779 (diff) | |
download | atril-b7fd397eb4a7a17a671b29e818b63718ab618b63.tar.bz2 atril-b7fd397eb4a7a17a671b29e818b63718ab618b63.tar.xz |
Use GLib's new g_clear_signal_handler() function to simplify code
Diffstat (limited to 'cut-n-paste')
-rw-r--r-- | cut-n-paste/toolbar-editor/egg-toolbar-editor.c | 6 |
1 files changed, 6 insertions, 0 deletions
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 } } |