From: SeungWon Lee Date: Sat, 13 Jul 2013 12:23:43 +0000 (+0900) Subject: Enhace scene transition logic for safe destroy of pending one. X-Git-Tag: submit/tizen_2.2/20130716.173726~33^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2f99705ca72e187d4c13b2af786c4067dc72313b;p=framework%2Fosp%2Fuifw.git Enhace scene transition logic for safe destroy of pending one. Change-Id: I0072c84a6af8d8629ac5a08c0fba9909d7e72711 Signed-off-by: SeungWon Lee --- diff --git a/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp b/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp index 016c4e1..8ac9efb 100644 --- a/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp +++ b/src/ui/scenes/FUiScenes_SceneManagerImpl.cpp @@ -108,6 +108,7 @@ _SceneManagerImpl::_SceneManagerImpl(void) , __correspondFrameControlHandle() , __sceneTransitionProgressing(false) , __pDisabledForm(null) + , __destroyPendingScene(L"") { for (int i = 0; i < FRAME_ANIMATOR_FORM_TRANSITION_ANIMATION_MAX; i++) { @@ -960,7 +961,19 @@ _SceneManagerImpl::OnSceneControlEventReceived(_SceneControlEventArg::SceneContr switch (eventType) { case _SceneControlEventArg::SCENE_CONTROL_EVENT_TYPE_DESTROY: - DestroyScene(sceneId); + if (!__destroyPendingScene.IsEmpty()) + { + SysTryLog(NID_UI_SCENES, __destroyPendingScene == sceneId, "Abnormal! __destroyPendingScene != sceneId"); + DestroyScene(sceneId); + if (__destroyPendingScene == sceneId) + { + __destroyPendingScene.Clear(); + } + } + else + { + SysSecureLog(NID_UI_SCENES, "The Scene was already destroyed on the GotoScene."); + } break; default: @@ -1034,6 +1047,19 @@ _SceneManagerImpl::GotoScene(bool forward, const SceneId& sceneId, SceneTransiti // 2. Find the Scene on SceneContainer - Scene and correspond UI control has same life time. pScene = GetSceneFromContainer(sceneId); + + // If the destination Scene is pending to destroy then destroy and invalidate the pScene + if (pScene && !__destroyPendingScene.IsEmpty()) + { + if (sceneId == __destroyPendingScene) + { + __destroyPendingScene.Clear(); + DestroyScene(sceneId); + pScene = null; + SysLog(NID_UI_SCENES, "DestroySceneAsync not finished, Do force destroy."); + } + } + if (pScene) // Activate pScene: Scene already existing then Re-activate associated a Form and a Panel. { sceneAlreadyCreated = true; @@ -1696,6 +1722,7 @@ _SceneManagerImpl::DestroySceneAsync(const SceneId& sceneId) SysTryReturnVoidResult(NID_UI_SCENES, pArg != null, E_OUT_OF_MEMORY, "[%s] Memory allocation failed.", GetErrorMessage(E_OUT_OF_MEMORY)); __sceneControlEvent.FireAsync(*pArg); + __destroyPendingScene = sceneId; } void diff --git a/src/ui/scenes/FUiScenes_SceneManagerImpl.h b/src/ui/scenes/FUiScenes_SceneManagerImpl.h index d5a4ca6..e8b7ffb 100644 --- a/src/ui/scenes/FUiScenes_SceneManagerImpl.h +++ b/src/ui/scenes/FUiScenes_SceneManagerImpl.h @@ -211,6 +211,7 @@ private: bool __sceneTransitionProgressing; Tizen::Base::Runtime::Mutex __sceneTransitionMutex; Tizen::Ui::Controls::Form* __pDisabledForm; + SceneId __destroyPendingScene; }; // _SceneManagerImpl } } } // Tizen::Ui::Scenes