Fixed memory leaks
[apps/osp/Gallery.git] / src / GlFileListForm.cpp
index d3ba711..52db43c 100644 (file)
@@ -51,6 +51,14 @@ FileListForm::FileListForm(void)
 FileListForm::~FileListForm(void)
 {
        AppLogDebug("ENTER");
+
+       if ( __pPopUp != NULL )
+       {
+               delete __pPopUp;
+               __pPopUp = NULL;
+       }
+
+
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
@@ -165,7 +173,7 @@ FileListForm::OnActionPerformed(const Control& source, int actionId)
                pDataList->Construct();
                pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_CAMERA_ALLOW_SWITCH), new (std::nothrow) String(APPCONTROL_DATA_TRUE));
                __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CAMERA, APPCONTROL_OPERATION_ID_CREATE_CONTENT,
-                               null, new (std::nothrow) String(APPCONTROL_MIME_IMAGE_JPG), pDataList, null);
+                               null, new (std::nothrow) String(APPCONTROL_MIME_IMAGE_JPG), pDataList, this);
        }
        break;
 
@@ -224,6 +232,7 @@ FileListForm::InitializeFooter(void)
        }
        pFooter->AddItem(itemCamera);
 
+       delete pBitmapCamera;
 
        if (__pOptionMenu != null)
        {
@@ -336,3 +345,14 @@ FileListForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
        }
 
 }
+
+void
+FileListForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId,
+                       AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       AppLogDebug("OnAppControlCompleteResponseReceived : %d", appControlResult);
+
+       GalleryApp* pGalleryApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
+       TryReturnVoid(pGalleryApp != null, "pGalleryApp is null");
+       pGalleryApp->SetFrameEnabled(true);
+}