Fix a crash issue 70/159270/1
authorHeeyong Song <heeyong.song@samsung.com>
Wed, 8 Nov 2017 01:52:30 +0000 (10:52 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Wed, 8 Nov 2017 01:52:30 +0000 (10:52 +0900)
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

index 2827310..ff84a6e 100644 (file)
@@ -280,8 +280,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 )
@@ -715,7 +713,7 @@ void Adaptor::OnWindowShown()
 
 void Adaptor::OnWindowHidden()
 {
-  if ( STOPPED != mState )
+  if ( RUNNING == mState )
   {
     Pause();
 
@@ -758,6 +756,8 @@ void Adaptor::NotifySceneCreated()
 
   // process after surface is created (registering to remote surface provider if required)
   SurfaceInitialized();
+
+  mState = RUNNING;
 }
 
 void Adaptor::NotifyLanguageChanged()