summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiwoong Im <jiwoong.im@samsung.com>2016-12-29 18:36:25 +0900
committerJiwoong Im <jiwoong.im@samsung.com>2016-12-29 18:57:12 +0900
commitc1f809f715b2fa5e6e4ae411ea6fd08936806a0c (patch)
tree5ad93d607321601bfc4981f2d6571d2482c9d57d
parent4c3ff9e7a56d83a2aed1f66032f0a8bfbd8bbd27 (diff)
downloadalarm-manager-accepted/tizen_3.0.m2_mobile.tar.gz
alarm-manager-accepted/tizen_3.0.m2_mobile.tar.bz2
alarm-manager-accepted/tizen_3.0.m2_mobile.zip
- Some finalize step for session bus connection is missing. Change-Id: Iaf033059e35efcdedadab05bb8e305825086b0c1 Signed-off-by: Jiwoong Im <jiwoong.im@samsung.com>
-rw-r--r--src/alarm-lib.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/alarm-lib.c b/src/alarm-lib.c
index f721c8a..01e7325 100644
--- a/src/alarm-lib.c
+++ b/src/alarm-lib.c
@@ -596,13 +596,20 @@ error:
EXPORT_API void alarmmgr_fini()
{
SECURE_LOGD("Enter");
+ bool is_user = false;
+
+ if (getuid() >= REGULAR_UID_MIN)
+ is_user = true;
+
if (introspection_data) {
g_dbus_node_info_unref(introspection_data);
introspection_data = NULL;
}
- if (alarm_context.connection != NULL && registration_id != 0) {
- g_dbus_connection_unregister_object(alarm_context.connection, registration_id);
+ if (registration_id != 0) {
+ g_dbus_connection_unregister_object(is_user ?
+ alarm_context.session_conn : alarm_context.connection,
+ registration_id);
registration_id = 0;
}
@@ -616,7 +623,7 @@ EXPORT_API void alarmmgr_fini()
alarm_context.connection = NULL;
}
- if (alarm_context.connection) {
+ if (alarm_context.session_conn) {
g_object_unref(alarm_context.session_conn);
alarm_context.session_conn = NULL;
}