summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2010-08-05 10:56:11 +0100
committerBastien Nocera <hadess@hadess.net>2010-08-05 10:57:44 +0100
commit07e11de11a9f84209b31ebffdeec4983f91b9dae (patch)
tree5448b75ef956479b7ee35e81722257f8ede4739f /lib
parent9f355c1721553c3ca4f34c9b62c44bb58015a4e7 (diff)
downloadtotem-07e11de11a9f84209b31ebffdeec4983f91b9dae.tar.gz
Ref TotemScreensaver so it's still valid in the cb
Especially on exit, we need to keep our own reference of the screensaver object, or it might disappear by the time we receive the callback from GDBus. https://bugzilla.gnome.org/show_bug.cgi?id=626092
Diffstat (limited to 'lib')
-rw-r--r--lib/totem-scrsaver.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/totem-scrsaver.c b/lib/totem-scrsaver.c
index cbda04078..7fb730742 100644
--- a/lib/totem-scrsaver.c
+++ b/lib/totem-scrsaver.c
@@ -115,6 +115,7 @@ on_inhibit_cb (GObject *source_object,
g_warning ("Problem inhibiting the screensaver: %s", error->message);
}
g_error_free (error);
+ g_object_unref (scr);
return;
}
@@ -125,6 +126,8 @@ on_inhibit_cb (GObject *source_object,
else
scr->priv->cookie = 0;
g_variant_unref (value);
+
+ g_object_unref (scr);
}
static void
@@ -155,6 +158,7 @@ on_uninhibit_cb (GObject *source_object,
g_warning ("Problem uninhibiting the screensaver: %s", error->message);
}
g_error_free (error);
+ g_object_unref (scr);
return;
}
@@ -162,6 +166,8 @@ on_uninhibit_cb (GObject *source_object,
/* clear the cookie */
scr->priv->cookie = 0;
g_variant_unref (value);
+
+ g_object_unref (scr);
}
static void
@@ -174,6 +180,7 @@ screensaver_inhibit_dbus (TotemScrsaver *scr,
return;
scr->priv->old_dbus_api = FALSE;
+ g_object_ref (scr);
if (inhibit) {
g_return_if_fail (scr->priv->reason != NULL);