From: Hwankyu Jhun Date: Fri, 19 Mar 2021 02:13:44 +0000 (+0900) Subject: Fix wrong implemenation of component lifecycle X-Git-Tag: submit/tizen/20210319.023247~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8f595cedfc0d1af4d10d2e58c3ebe494a15d6efc;p=platform%2Fcore%2Fappfw%2Fcomponent-based-application.git Fix wrong implemenation of component lifecycle If the state is running, the component should not go to the started state. Change-Id: I11cd3eb1f9c440d78c8079ad9fd3c9088aa2b8c7 Signed-off-by: Hwankyu Jhun --- diff --git a/component_based/base/component.cc b/component_based/base/component.cc index a8cc61c..8b2d1cf 100644 --- a/component_based/base/component.cc +++ b/component_based/base/component.cc @@ -65,8 +65,12 @@ void Component::Impl::OnDestroy() { void Component::Impl::OnStart(AppControl control, bool restarted) { parent_->OnBaseStart(control, restarted); - state_ = State::Started; - aul_comp_status_update(inst_id_.c_str(), COMP_STATUS_STARTED); + if (state_ == State::Created || + state_ == State::Paused || + state_ == State::Stopped) { + state_ = State::Started; + aul_comp_status_update(inst_id_.c_str(), COMP_STATUS_STARTED); + } } void Component::Impl::OnResume() { diff --git a/component_based/base/frame_component.cc b/component_based/base/frame_component.cc index 399aa7e..5d7646f 100644 --- a/component_based/base/frame_component.cc +++ b/component_based/base/frame_component.cc @@ -76,6 +76,9 @@ void FrameComponent::OnBaseDestroy() { } void FrameComponent::OnBaseStart(AppControl control, bool restarted) { + if (GetState() == State::Running) + return; + tizen_base::Bundle content = GetContent(); OnBaseRestoreContent(content); OnStart(control, restarted);