Modified dbus server release steps. 11/133111/1 accepted/tizen/unified/20170609.210652 submit/tizen/20170609.054453
authorSegwon <segwon.han@samsung.com>
Fri, 9 Jun 2017 03:51:10 +0000 (12:51 +0900)
committerSegwon <segwon.han@samsung.com>
Fri, 9 Jun 2017 03:51:54 +0000 (12:51 +0900)
Connections created with g_bus_own_name () are automatically released when id unown.

Signed-off-by: Segwon <segwon.han@samsung.com>
Change-Id: Idf0a0b4332e1bfdfa48aa0475133524f4e23127a

daemon/DbusServer.cpp

index fbe3f6ffd68c2915f882993fc9f74bd65dad91b5..288c79602821231573ebb5a773a24c5bbf8b74ca 100755 (executable)
@@ -169,7 +169,6 @@ static void __on_name_acquired(GDBusConnection *conn, const gchar *name, gpointe
 static void __on_name_lost(GDBusConnection *conn, const gchar *name, gpointer user_data)
 {
        _E("Dbus name lost");
-       raise(SIGTERM);
 }
 
 conv::DbusServer::DbusServer()
@@ -178,7 +177,6 @@ conv::DbusServer::DbusServer()
 
 conv::DbusServer::~DbusServer()
 {
-       release();
 }
 
 bool conv::DbusServer::init()
@@ -209,20 +207,16 @@ bool conv::DbusServer::init()
 
 void conv::DbusServer::release()
 {
-       if (dbusConnection)
+       if (dbusConnection){
                g_dbus_connection_flush_sync(dbusConnection, NULL, NULL);
+               dbusConnection = NULL;
+       }
 
        if (dbusOwnerId > 0) {
                g_bus_unown_name(dbusOwnerId);
                dbusOwnerId = 0;
        }
 
-       if (dbusConnection) {
-               g_dbus_connection_close_sync(dbusConnection, NULL, NULL);
-               g_object_unref(dbusConnection);
-               dbusConnection = NULL;
-       }
-
        if (dbusNodeInfo) {
                g_dbus_node_info_unref(dbusNodeInfo);
                dbusNodeInfo = NULL;