Resolved issue N_SE-39048
[apps/osp/Calendar.git] / src / ClListPanel.cpp
index 4b455c1..c244931 100644 (file)
@@ -81,6 +81,7 @@ ListPanel::ListPanel(void)
        , __pSharePopup(null)
        , __pThreeButtonPopup(null)
        , __pTwoButtonPopup(null)
+       , __pGoToDatePopup(null)
 {
 }
 
@@ -132,6 +133,9 @@ ListPanel::OnInitializing(void)
        __pTwoButtonPopup = new (std::nothrow) TwoButtonPopup();
        __pTwoButtonPopup->Initialize();
 
+       __pGoToDatePopup = new (std::nothrow) GoToDatePopup();
+       __pGoToDatePopup->Initialize();
+
        return E_SUCCESS;
 }
 
@@ -144,9 +148,23 @@ ListPanel::OnTerminating(void)
        delete __pContextItem;
        delete __pContextItemNoEdit;
        delete __pDateFormatter;
-       delete __pSharePopup;
-       delete __pThreeButtonPopup;
-       delete __pTwoButtonPopup;
+
+       if (__pSharePopup)
+       {
+               __pSharePopup->Destroy();
+       }
+       if (__pThreeButtonPopup)
+       {
+               __pThreeButtonPopup->Destroy();
+       }
+       if (__pTwoButtonPopup)
+       {
+               __pTwoButtonPopup->Destroy();
+       }
+       if (__pGoToDatePopup)
+       {
+               __pGoToDatePopup->Destroy();
+       }
 
        return E_SUCCESS;
 }
@@ -184,7 +202,7 @@ ListPanel::OnUserEventReceivedN(RequestId requestId, IList* pArgs)
        }
                break;
        case IDA_SUB_MENU_GO_TO_DATE:
-               GoToDatePopup::RequestGoToDate(__pPm->GetCurrentDate(), this);
+               __pGoToDatePopup->RequestPopup(__pPm->GetCurrentDate(), this);
                break;
        case IDA_SUB_MENU_DELETE:
                SceneManager::GetInstance()->GoForward(ForwardSceneTransition(IDSCN_EVENT_DELETER,