[gnome-software] Fix a crasher in the screenshot loader



commit 752b5351711031b10a120484210e46919f0c2b00
Author: Richard Hughes <richard hughsie com>
Date:   Fri Nov 29 14:45:47 2013 +0000

    Fix a crasher in the screenshot loader
    
    If the user switches away back to the overview before the screenshot has
    finished downloading, we can crash the service in some circumstances.

 src/gs-screenshot-image.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/src/gs-screenshot-image.c b/src/gs-screenshot-image.c
index 450c2a6..730b4a7 100644
--- a/src/gs-screenshot-image.c
+++ b/src/gs-screenshot-image.c
@@ -163,7 +163,7 @@ gs_screenshot_image_complete_cb (SoupSession *session,
        /* got image, so show */
        gs_screenshot_show_image (ssimg);
 out:
-       return;
+       g_object_unref (ssimg);
 }
 
 /**
@@ -309,7 +309,7 @@ gs_screenshot_image_load_async (GsScreenshotImage *ssimg,
        /* send async */
        soup_session_queue_message (priv->session, msg,
                                    gs_screenshot_image_complete_cb,
-                                   ssimg);
+                                   g_object_ref (ssimg));
        if (priv->spinner_id != 0)
                g_source_remove (priv->spinner_id);
        priv->spinner_id = g_timeout_add (250, gs_screenshot_image_show_spinner, ssimg);


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