[gnome-power-manager] Make session requested quit work and not crash
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-power-manager] Make session requested quit work and not crash
- Date: Wed, 3 Nov 2010 11:07:40 +0000 (UTC)
commit 4e576eeb11f352bbf384466cb7702516c5209876
Author: Yanko Kaneti <yaneti declera com>
Date: Wed Nov 3 11:07:28 2010 +0000
Make session requested quit work and not crash
- Don't feed NULLs to g_variant_new.
- Send EndSessionResponse to the correct dbus proxy.
Signed-off-by: Richard Hughes <richard hughsie com>
src/gpm-main.c | 12 +++---------
1 files changed, 3 insertions(+), 9 deletions(-)
---
diff --git a/src/gpm-main.c b/src/gpm-main.c
index af0f060..19acf8c 100644
--- a/src/gpm-main.c
+++ b/src/gpm-main.c
@@ -70,13 +70,7 @@ gpm_main_session_end_session_response (gboolean is_okay, const gchar *reason)
g_return_val_if_fail (session_proxy_client != NULL, FALSE);
- /* no gnome-session */
- if (session_proxy == NULL) {
- g_warning ("no gnome-session");
- goto out;
- }
-
- retval = g_dbus_proxy_call_sync (session_proxy,
+ retval = g_dbus_proxy_call_sync (session_proxy_client,
"EndSessionResponse",
g_variant_new ("(bs)",
is_okay,
@@ -109,12 +103,12 @@ gpm_main_session_dbus_signal_cb (GDBusProxy *proxy, const gchar *sender_name, co
}
if (g_strcmp0 (signal_name, "QueryEndSession") == 0) {
/* just send response */
- gpm_main_session_end_session_response (TRUE, NULL);
+ gpm_main_session_end_session_response (TRUE, "");
return;
}
if (g_strcmp0 (signal_name, "EndSession") == 0) {
/* send response */
- gpm_main_session_end_session_response (TRUE, NULL);
+ gpm_main_session_end_session_response (TRUE, "");
/* exit loop, will unref manager */
g_main_loop_quit (loop);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]