User dynamic cast for base-to-derived conversion 60/150460/1
authorZofia Abramowska <z.abramowska@samsung.com>
Fri, 15 Sep 2017 15:42:06 +0000 (17:42 +0200)
committerZofia Abramowska <z.abramowska@samsung.com>
Fri, 15 Sep 2017 16:03:53 +0000 (18:03 +0200)
Change-Id: I4f3f9c4062197941cb23fa5c40c883c6d26d877f

src/server/main/socket-manager.cpp

index ec2e3d7..ef69a15 100644 (file)
@@ -100,7 +100,9 @@ struct SignalService : public GenericSocketService {
 
         if (siginfo->ssi_signo == SIGTERM) {
             LogInfo("Got signal: SIGTERM");
-            static_cast<SocketManager*>(m_serviceManager)->MainLoopStop();
+            auto manager = dynamic_cast<SocketManager*>(m_serviceManager);
+            if (manager)
+                manager->MainLoopStop();
             return;
         }