Fix memory leak
authorkhee85.lee <khee85.lee@samsung.com>
Fri, 21 Mar 2014 10:24:21 +0000 (19:24 +0900)
committerkhee85.lee <khee85.lee@samsung.com>
Fri, 21 Mar 2014 10:24:21 +0000 (19:24 +0900)
Change-Id: I38110a1c5c6797932cec32bc11afb8cc963be12f
Signed-off-by: khee85.lee <khee85.lee@samsung.com>
src/ui/animations/FUiAnim_GlRenderManager.cpp
src/ui/animations/FUiAnim_VisualElementSurfaceManager.cpp
src/ui/controls/FUiCtrl_EcoreIpcSocket.cpp
src/ui/controls/FUiCtrl_EcoreIpcSocket.h

index d02f984..0217f7a 100644 (file)
@@ -988,6 +988,7 @@ _GlRenderManager::~_GlRenderManager(void)
        pthread_join(__threadInfo, NULL);
 
        delete [] __pRenderQueue;
+       delete [] __pRenderQueueForFlush;
 
        delete __pTempNode;
 }
index 4018fe8..a7aafbf 100644 (file)
@@ -486,7 +486,14 @@ _VisualElementSurfaceManager::DeleteTexturesOnRenderManagerIfNeeded(_GlContext*
        for(int i=0; i<pendingTextureList.GetCount(); i++)
        {
 //             AppLog("khee85::GlRenderManager DeleteTexture %d", i);
-               context->DeleteTexture(pendingTextureList.GetTextureInfoAt(i));
+               TextureInfo* tempTextureInfo = pendingTextureList.GetTextureInfoAt(i);
+               context->DeleteTexture(tempTextureInfo);
+
+               if (tempTextureInfo->type == TEXTURE_NORMAL)
+               {
+                       delete [] tempTextureInfo->pPixels;
+                       tempTextureInfo->pPixels = null;
+               }
        }
        pendingTextureList.RemoveAllTextureInfo();
 }
@@ -567,8 +574,6 @@ _VisualElementSurfaceManager::CommandHandlerFinalizeGLLayer(_GlLayer* pGlLayer)
        return true;
 }
 
-
-
 bool
 _VisualElementSurfaceManager::CommandHandlerCreateTexture(TextureInfo* pTextureInfo)
 {
index 20f191d..237549b 100644 (file)
@@ -21,6 +21,13 @@ using namespace Tizen::Graphics;
 const int sizeOfInt = static_cast<int>(sizeof(int));
 
 namespace Tizen { namespace Ui { namespace Controls {
+_EcoreIpcMessage::~_EcoreIpcMessage()
+{
+       if(pData)
+       {
+               free(pData);
+       }
+}
 
 _EcoreIpcSocket::_EcoreIpcSocket(void)
        : __socketId(0)
@@ -87,8 +94,12 @@ _EcoreIpcSocket::Read(void)
        int size = read(__socketId, buf, READ_BUFFER_SIZE);
        if (size > 0)
        {
-               const IList* pMessageList = DecodeToMessageListN(buf, size);
-               if (pMessageList != null && __pListener != null)
+               if (__pListener == null)
+               {
+                       return r;
+               }
+               IList* pMessageList = DecodeToMessageListN(buf, size);
+               if (pMessageList != null )
                {
                        int count = pMessageList->GetCount();
 
@@ -139,10 +150,12 @@ _EcoreIpcSocket::Read(void)
                                                PRINT("_EcoreIpcSocket : DEFAULT !!!!\n");
                                                break;
                                        }
+                                       delete pMessage;
                                }
                        }
                }
 
+               pMessageList->RemoveAll();
                delete pMessageList;
        }
 
@@ -295,7 +308,7 @@ _EcoreIpcSocket::Send(_EcoreIpcMessageType type, int ref, int refTo, int respons
        return r;
 }
 
-const IList*
+IList*
 _EcoreIpcSocket::DecodeToMessageListN(unsigned char* pReadBuffer, int bufSize)
 {
        ArrayList* pMessageList = new ArrayList();
index 0275983..eea3233 100644 (file)
@@ -30,7 +30,7 @@ public:
        {
        }
 
-       virtual ~_EcoreIpcMessage(void) {}
+       virtual ~_EcoreIpcMessage(void);
 
 public:
        _EcoreIpcMessageType type;
@@ -74,7 +74,7 @@ public:
        void SetEcoreIpcSocketEventListener(_IEcoreIpcSocketEventListener* pListener);
 
 private:
-       const Tizen::Base::Collection::IList* DecodeToMessageListN(unsigned char* readBuffer, int size);
+       Tizen::Base::Collection::IList* DecodeToMessageListN(unsigned char* readBuffer, int size);
 
        int SetMessageField(int out, int prev, int *mode);
        const int GetMessageField(int in, int prev, int mode) const;