Modified dbus server release steps 07/133107/1
authorkmook <kmook.choi@samsung.com>
Fri, 9 Jun 2017 02:45:04 +0000 (11:45 +0900)
committerkmook <kmook.choi@samsung.com>
Fri, 9 Jun 2017 02:45:04 +0000 (11:45 +0900)
Change-Id: I24316b52fbc7700c25fdef9650efe5a53f5b0a05
Signed-off-by: kmook <kmook.choi@samsung.com>
daemon/DbusServer.cpp
daemon/Server.cpp

index fbe3f6ffd68c2915f882993fc9f74bd65dad91b5..7ce3ecbee2549e36c3901220aead898ddffa575e 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;
index 5657bc818a9bfe1884bbbf26f97bb240a6dfc2ce..0d1d6220ff7d192d1753679f70afee4b8714ffbb 100644 (file)
@@ -158,6 +158,7 @@ void conv::release()
                requestMgr->release();
 
        g_main_loop_unref(mainLoop);
+       mainLoop = NULL;
 
        delete discoveryMgr;
        delete connectionMgr;
@@ -188,7 +189,6 @@ static void signal_handler(int signo)
        // Stop the main loop
        if (mainLoop) {
                g_main_loop_quit(mainLoop);
-               mainLoop = NULL;
        }
 }