destroy all, event and folder layout when gallery view is destroyed 95/37895/1
authorJehun Lim <jehun.lim@samsung.com>
Wed, 8 Apr 2015 06:47:27 +0000 (15:47 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Wed, 8 Apr 2015 06:47:27 +0000 (15:47 +0900)
Change-Id: I4a60047163599c3bb7a92e132e57a5df10227ffa
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
src/view/gallery-view/gallery_view.cpp

index 19d748b..4690c6f 100644 (file)
@@ -616,16 +616,26 @@ void CGalleryView::Destroy(void)
 {
        ASSERT(m);
 
-       CBaseView::Destroy();
-
        CMediaContentDbUpdateListener::Destroy();
        CUsbConnectionListener::Destroy();
 
        m->pMediadata->DestroyMediaList();
 
        m->pLayoutMgr->RemoveLayout(m->pAllLayout);
+       m->pAllLayout->Destroy();
+       delete m->pAllLayout;
+
        m->pLayoutMgr->RemoveLayout(m->pEventLayout);
+       m->pEventLayout->Destroy();
+       delete m->pEventLayout;
+
        m->pLayoutMgr->RemoveLayout(m->pFolderLayout);
+       m->pFolderLayout->Destroy();
+       delete m->pFolderLayout;
+
+       CBaseView::Destroy();
+       m->pLayoutMgr->Destroy();
+       delete m->pLayoutMgr;
 
        if (m->arglist) {
                free(m->arglist->id);
@@ -642,7 +652,7 @@ void CGalleryView::Destroy(void)
 
        evas_object_del(m->base);
 
-       free(m);
+       delete m;
        m = NULL;
 }