[gnome-software/wip/attente/gapplication] Fix crash



commit ec12749a25498554f286d75fb1a04b1f517d8788
Author: William Hua <william hua canonical com>
Date:   Tue Mar 22 17:43:36 2016 -0400

    Fix crash

 src/gs-shell-installed.c |   11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)
---
diff --git a/src/gs-shell-installed.c b/src/gs-shell-installed.c
index 813843d..38b8d35 100644
--- a/src/gs-shell-installed.c
+++ b/src/gs-shell-installed.c
@@ -194,8 +194,10 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
        g_autoptr(GError) error = NULL;
        g_autoptr(GsAppList) list = NULL;
 
-       gs_stop_spinner (GTK_SPINNER (self->spinner_install));
-       gtk_stack_set_visible_child_name (GTK_STACK (self->stack_install), "view");
+       if (self->spinner_install != NULL)
+               gs_stop_spinner (GTK_SPINNER (self->spinner_install));
+       if (self->stack_install != NULL)
+               gtk_stack_set_visible_child_name (GTK_STACK (self->stack_install), "view");
 
        self->waiting = FALSE;
        self->cache_valid = TRUE;
@@ -212,8 +214,9 @@ gs_shell_installed_get_installed_cb (GObject *source_object,
                app = GS_APP (l->data);
                gs_shell_installed_add_app (self, app);
        }
-out:
        gs_shell_installed_pending_apps_changed_cb (plugin_loader, self);
+out:
+       g_object_unref (self);
 }
 
 /**
@@ -241,7 +244,7 @@ gs_shell_installed_load (GsShellInstalled *self)
                                              GS_PLUGIN_REFINE_FLAGS_REQUIRE_RATING,
                                              self->cancellable,
                                              gs_shell_installed_get_installed_cb,
-                                             self);
+                                             g_object_ref (self));
        gs_start_spinner (GTK_SPINNER (self->spinner_install));
        gtk_stack_set_visible_child_name (GTK_STACK (self->stack_install), "spinner");
 }


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