[gnome-control-center] applications: Fix NULL hash table being unreffed.



commit b259d5207bd0f746b810e11aa559ebee99b12d18
Author: Robert Ancell <robert ancell canonical com>
Date:   Tue Nov 10 09:45:47 2020 +1300

    applications: Fix NULL hash table being unreffed.
    
    When clicking away from the applications panel you can see:
    (gnome-control-center:95304): GLib-CRITICAL **: 09:12:52.941: g_hash_table_unref: assertion 'hash_table 
!= NULL' failed

 panels/applications/cc-applications-panel.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/panels/applications/cc-applications-panel.c b/panels/applications/cc-applications-panel.c
index 19b477cfe..6b9a1c05b 100644
--- a/panels/applications/cc-applications-panel.c
+++ b/panels/applications/cc-applications-panel.c
@@ -1879,10 +1879,10 @@ cc_applications_panel_finalize (GObject *object)
   g_clear_object (&self->privacy_settings);
   g_clear_object (&self->search_settings);
 
-  g_free (self->current_app_id);
-  g_free (self->current_portal_app_id);
-  g_hash_table_unref (self->globs);
-  g_hash_table_unref (self->search_providers);
+  g_clear_pointer (&self->current_app_id, g_free);
+  g_clear_pointer (&self->current_portal_app_id, g_free);
+  g_clear_pointer (&self->globs, g_hash_table_unref);
+  g_clear_pointer (&self->search_providers, g_hash_table_unref);
 
   G_OBJECT_CLASS (cc_applications_panel_parent_class)->finalize (object);
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]