Fixed issue 47315
[apps/osp/Gallery.git] / src / GlFileListForm.cpp
index e4a47d9..dc276e0 100644 (file)
@@ -83,15 +83,6 @@ FileListForm::OnInitializing(void)
        __pPresentationModel = FileListPresentationModel::GetInstance();
        __pPresentationModel->ClearThumbnailRequests();
 
-       __pPopUp = new (std::nothrow) SlideShowPopUp();
-
-       if (__pPopUp != null)
-       {
-               __pPopUp->Initialize();
-               __pPopUp->SetEventListner(this);
-               AddControl(__pPopUp);
-       }
-
        InitializeFooter();
        SetFormBackEventListener(this);
        SetOrientation(ORIENTATION_AUTOMATIC);
@@ -159,8 +150,17 @@ FileListForm::OnActionPerformed(const Control& source, int actionId)
        case IDA_FOOTER_SLIDESHOW:
        {
 
+               if (__pPopUp != NULL)
+               {
+                       delete __pPopUp;
+                       __pPopUp = NULL;
+               }
+               __pPopUp = new (std::nothrow) SlideShowPopUp();
+
                if (__pPopUp != null)
                {
+                       __pPopUp->Initialize();
+                       __pPopUp->SetEventListner(this);
                        __pPopUp->SetShowState(true);
                        __pPopUp->Show();
                }