From d0c4374a0b3ad0a5b0e0a009d6eebceb5b815229 Mon Sep 17 00:00:00 2001 From: Evangelos Ribeiro Tzaras Date: Sat, 3 Sep 2022 10:51:57 +0200 Subject: [PATCH] mm-provider: Prefer g_clear_*() in dispose() and finalize() --- plugins/provider/mm/calls-mm-provider.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/plugins/provider/mm/calls-mm-provider.c b/plugins/provider/mm/calls-mm-provider.c index e6ecc0f..64d0555 100644 --- a/plugins/provider/mm/calls-mm-provider.c +++ b/plugins/provider/mm/calls-mm-provider.c @@ -387,10 +387,7 @@ dispose (GObject *object) { CallsMMProvider *self = CALLS_MM_PROVIDER (object); - if (self->watch_id) { - g_bus_unwatch_name (self->watch_id); - self->watch_id = 0; - } + g_clear_handle_id (&self->watch_id, g_bus_unwatch_name); g_list_store_remove_all (self->origins); @@ -403,8 +400,8 @@ finalize (GObject *object) { CallsMMProvider *self = CALLS_MM_PROVIDER (object); - g_object_unref (self->origins); - g_free (self->status); + g_clear_object (&self->origins); + g_clear_pointer (&self->status, g_free); G_OBJECT_CLASS (calls_mm_provider_parent_class)->finalize (object); }