aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend-dbus/actions.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/backend-dbus/actions.c b/src/backend-dbus/actions.c
index 3f0e6ec..67fe9f1 100644
--- a/src/backend-dbus/actions.c
+++ b/src/backend-dbus/actions.c
@@ -326,11 +326,18 @@ my_can_hibernate (IndicatorSessionActions * self)
static gboolean
my_can_prompt (IndicatorSessionActions * self)
{
+ gboolean can_prompt = FALSE;
const priv_t * p = INDICATOR_SESSION_ACTIONS_DBUS(self)->priv;
- return (p != NULL)
- && (p->end_session_dialog != NULL)
- && (g_dbus_proxy_get_name_owner (G_DBUS_PROXY(p->end_session_dialog)) != NULL);
+ if (p && p->end_session_dialog)
+ {
+ GDBusProxy * proxy = G_DBUS_PROXY (p->end_session_dialog);
+ char * name = g_dbus_proxy_get_name_owner (proxy);
+ can_prompt = name != NULL;
+ g_free (name);
+ }
+
+ return can_prompt;
}
static gboolean