[gnome-control-center] background: Avoid accessing the panel if cancelled



commit f959d3072be60032da10f986f3a81f32fdb06059
Author: Bastien Nocera <hadess hadess net>
Date:   Wed Jan 30 15:46:40 2013 +0100

    background: Avoid accessing the panel if cancelled
    
    If the background panel was closed, we shouldn't try to access
    panel's internals as it's already been freed.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=880859

 panels/background/cc-background-panel.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index de4f65c..86e7250 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -243,7 +243,7 @@ on_screenshot_finished (GObject *source,
 {
   ScreenshotData *data = user_data;
   CcBackgroundPanel *panel = data->panel;
-  CcBackgroundPanelPrivate *priv = panel->priv;
+  CcBackgroundPanelPrivate *priv;
   GError *error;
   GdkPixbuf *pixbuf;
   cairo_surface_t *surface;
@@ -270,6 +270,8 @@ on_screenshot_finished (GObject *source,
   }
   g_variant_unref (result);
 
+  priv = panel->priv;
+
   pixbuf = gdk_pixbuf_new_from_file (panel->priv->screenshot_path, &error);
   if (pixbuf == NULL)
     {



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