mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-09 04:15:49 +01:00
5ebd8f6e88
It's a very common pattern to see code that looks like this in dispose() or finalize() implementations: if (priv->source_id > 0) { g_source_remove (priv->source_id); priv->source_id = 0; } This API allows to accomplish the same goal with a single line: g_clear_handle_id (&priv->source_id, (GClearHandleFunc) g_source_remove); Thanks to Emmanuele Bassi <ebassi@gnome.org> for making the patch generic. https://bugzilla.gnome.org/show_bug.cgi?id=788489