GenericCommunicator: fixed crash during shutdown, if no ipcModule was loaded
authorTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 5 Jul 2012 09:51:26 +0000 (02:51 -0700)
committerTimo Lotterbach <timo.lotterbach@bmw-carit.de>
Thu, 5 Jul 2012 09:51:44 +0000 (02:51 -0700)
the GenericCommunicator always tried to destroy the ipcModule. this failed
and resulted in a crash, if no ipcModule was loaded during startup.

LayerManagerPlugins/Communicators/GenericCommunicator/include/GenericCommunicator.h
LayerManagerPlugins/Communicators/GenericCommunicator/src/GenericCommunicator.cpp

index 15d637a..55ba091 100644 (file)
@@ -202,14 +202,12 @@ public:
     void SetUniforms();
 
 private:
-    IpcModule m_ipcModule;
-    CallBackTable m_callBackTable;
-    // TODO: void AddClientWatch(DBusConnection *conn, char* sender);
     void RemoveApplicationReference(char* owner);
 
-
+private:
+    IpcModule m_ipcModule;
+    CallBackTable m_callBackTable;
     bool m_running;
-
 };
 
 #endif /* _DBUSCOMMUNICATOR_H_ */
index 856a71b..710341a 100644 (file)
@@ -171,6 +171,8 @@ bool GenericCommunicator::start()
     }
     LOG_DEBUG("GenericCommunicator", "Initializing IpcModule success.");
 
+    m_running = ILM_TRUE;
+
     return ILM_TRUE;
 }
 
@@ -179,7 +181,10 @@ void GenericCommunicator::stop()
     LOG_ENTER_FUNCTION;
     LOG_INFO("GenericCommunicator","stopping");
 
-    m_ipcModule.destroy();
+    if (m_running)
+    {
+        m_ipcModule.destroy();
+    }
 }
 
 void GenericCommunicator::process(int timeout_ms)