From f761e1fa4209b47ae18543797b0183b005b510b0 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Wed, 8 Nov 2017 10:52:30 +0900 Subject: [PATCH] [4.0] Fix a crash issue OnWindowHidden and OnWindowShown can be called before mThreadController is started in NotifySceneCreated. In this case mThreadController should not be paused or resumed. Change-Id: I63db11085a2682fb7a0199616e5e9381b672e06f --- adaptors/common/adaptor-impl.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/adaptors/common/adaptor-impl.cpp b/adaptors/common/adaptor-impl.cpp index 519cac6..c0a6699 100644 --- a/adaptors/common/adaptor-impl.cpp +++ b/adaptors/common/adaptor-impl.cpp @@ -276,8 +276,6 @@ void Adaptor::Start() // Initialize the thread controller mThreadController->Initialize(); - mState = RUNNING; - ProcessCoreEvents(); // Ensure any startup messages are processed. for ( ObserverContainer::iterator iter = mObservers.begin(), endIter = mObservers.end(); iter != endIter; ++iter ) @@ -714,7 +712,7 @@ void Adaptor::OnWindowShown() void Adaptor::OnWindowHidden() { - if ( STOPPED != mState ) + if ( RUNNING == mState ) { Pause(); @@ -757,6 +755,8 @@ void Adaptor::NotifySceneCreated() // process after surface is created (registering to remote surface provider if required) SurfaceInitialized(); + + mState = RUNNING; } void Adaptor::NotifyLanguageChanged() -- 2.7.4