[gnome-software/wip/ubuntu-changes] Nullify widgets on destroy



commit 1445e5ef2c0632e228fed4d6c8469cc332eabdc5
Author: William Hua <william hua canonical com>
Date:   Mon Mar 21 16:24:32 2016 -0400

    Nullify widgets on destroy

 src/gs-shell-updates.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/gs-shell-updates.c b/src/gs-shell-updates.c
index e1e17f2..e15a1af 100644
--- a/src/gs-shell-updates.c
+++ b/src/gs-shell-updates.c
@@ -468,9 +468,12 @@ gs_shell_updates_get_updates_cb (GsPluginLoader *plugin_loader,
 
        /* get the results */
        list = gs_plugin_loader_get_updates_finish (plugin_loader, res, &error);
-       for (l = list; l != NULL; l = l->next) {
-               gs_update_list_add_app (GS_UPDATE_LIST (self->list_box_updates),
-                                       GS_APP (l->data));
+
+       if (self->list_box_updates != NULL) {
+               for (l = list; l != NULL; l = l->next) {
+                       gs_update_list_add_app (GS_UPDATE_LIST (self->list_box_updates),
+                                               GS_APP (l->data));
+               }
        }
 
        widget = GTK_WIDGET (gtk_builder_get_object (self->builder, "button_updates_counter"));
@@ -1265,6 +1268,8 @@ gs_shell_updates_init (GsShellUpdates *self)
 
        gtk_widget_init_template (GTK_WIDGET (self));
 
+       gtk_widget_destroyed (self->list_box_updates, &self->list_box_updates);
+
        self->network_monitor = g_network_monitor_get_default ();
        self->state = GS_SHELL_UPDATES_STATE_STARTUP;
        self->settings = g_settings_new ("org.gnome.software");


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