{
ASSERT(m_pApp);
- CViewMgr::Finalize();
+ if (m_pVmgr) {
+ CViewMgr::Finalize();
+ m_pVmgr = NULL;
+ }
if (m_pApp->win)
evas_object_del(m_pApp->win);
{
ASSERT(m_pApp);
- m_pVmgr->Pause();
+ if (m_pVmgr)
+ m_pVmgr->Pause();
}
void CVideoPlayerApp::OnResume(void)
{
ASSERT(m_pApp);
- m_pVmgr->Resume();
+ if (m_pVmgr)
+ m_pVmgr->Resume();
}
void CVideoPlayerApp::OnAppControl(app_control_h app_control)
if (!m_pVmgr->PushView(VIEW_ID_PLAYER, ¶m)) {
_ERR("View push failed");
+
CViewMgr::Finalize();
+ m_pVmgr = NULL;
+
free(uri);
free(playlist);
elm_exit();
+ return;
}
free(uri);
else if (data->repeat == E_REPEAT_ALL)
r = playermgr_set_next_video(data->player, EINA_TRUE);
- if (!r)
+ if (!r) {
elm_exit();
+ return;
+ }
action = ACTION_INIT;
CViewMgr::GetInstance()->UpdateView(data->id, (void *)&action);
r = m_UiInit();
if (!r) {
- delete m;
- m = NULL;
+ _ERR("failed to init UI");
+ m_Fini();
return false;
}
if (!m_PlayerInit()) {
_ERR("failed to play video");
+ m_Fini();
return false;
}
m->drawanim_timer = ecore_timer_add(0.8, sm_CbDrawAnimation, m);
if (!m->drawanim_timer) {
_ERR("failed to add draw timer");
+ m_Fini();
return false;
}
return true;
}
-void CPlayerView::Destroy(void)
+void CPlayerView::m_Fini(void)
{
- ASSERT(m);
-
- CBaseView::Destroy();
-
if (m->drawanim_timer)
ecore_timer_del(m->drawanim_timer);
+ m->drawanim_timer = NULL;
delete m->mediadata;
m->mediadata = NULL;
playermgr_fini(m->player);
+ m->player = NULL;
timeout_handler_fini(m->timeout_handle);
+ m->timeout_handle = NULL;
free(m->id);
+ m->id = NULL;
m->volume->Destroy();
delete m->volume;
+ m->volume = NULL;
m->control->Destroy();
delete m->control;
+ m->control = NULL;
m->slider->Destroy();
delete m->slider;
+ m->slider = NULL;
delete m;
m = NULL;
}
+void CPlayerView::Destroy(void)
+{
+ ASSERT(m);
+
+ CBaseView::Destroy();
+
+ m_Fini();
+}
+
Evas_Object *CPlayerView::Base(void)
{
ASSERT(m);