[gnome-control-center/gnome-3-6] background: Avoid accessing the panel if cancelled
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/gnome-3-6] background: Avoid accessing the panel if cancelled
- Date: Wed, 30 Jan 2013 14:47:27 +0000 (UTC)
commit c3723cb9c84be856a02b099621cdcd8c58ca4190
Author: Bastien Nocera <hadess hadess net>
Date: Wed Jan 30 15:44:19 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 | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/panels/background/cc-background-panel.c b/panels/background/cc-background-panel.c
index a05e519..c9b8d76 100644
--- a/panels/background/cc-background-panel.c
+++ b/panels/background/cc-background-panel.c
@@ -234,7 +234,7 @@ on_screenshot_finished (GObject *source,
gpointer user_data)
{
CcBackgroundPanel *panel = user_data;
- CcBackgroundPanelPrivate *priv = panel->priv;
+ CcBackgroundPanelPrivate *priv;
GError *error;
GdkRectangle rect;
GdkRectangle workarea_rect;
@@ -248,7 +248,7 @@ on_screenshot_finished (GObject *source,
int primary;
error = NULL;
- result = g_dbus_connection_call_finish (panel->priv->connection,
+ result = g_dbus_connection_call_finish (G_DBUS_CONNECTION (source),
res,
&error);
@@ -265,6 +265,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]