Fix memory leak.
authorHokwon Song <hokwon.song@samsung.com>
Fri, 13 Sep 2013 05:41:17 +0000 (14:41 +0900)
committerHokwon Song <hokwon.song@samsung.com>
Fri, 13 Sep 2013 05:41:17 +0000 (14:41 +0900)
Change-Id: Id4ee58a001f6e3a19291f86bd1bc0fdf723b6cef
Signed-off-by: Hokwon Song <hokwon.song@samsung.com>
src/system/FSys_DeviceManagerStub.cpp
src/system/FSys_PowerManagerStub.cpp

index c01264e..5a34635 100644 (file)
@@ -67,6 +67,12 @@ _DeviceManagerStub::~_DeviceManagerStub(void)
 {
        __pDeviceManager->UnregisterListner(*this);
 
+       if (__pRegistry)
+       {
+               __pRegistry->Flush();
+               delete __pRegistry;
+       }
+
        if (__pIpcServer)
        {
                __pIpcServer->Stop();
index a868704..c379669 100644 (file)
@@ -64,7 +64,11 @@ _PowerManagerStub::~_PowerManagerStub(void)
                __pIpcServer->Stop();
        }
 
-       __pRegistry->Flush();
+       if (__pRegistry)
+       {
+               __pRegistry->Flush();
+               delete __pRegistry;
+       }
 }
 
 _PowerManagerStub*