Fix crash in exit of dali applications 64/39464/1
authorKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 15 May 2015 10:54:47 +0000 (11:54 +0100)
committerKimmo Hoikka <kimmo.hoikka@samsung.com>
Fri, 15 May 2015 10:56:07 +0000 (11:56 +0100)
[Problem] stage called rootactor.Remove( cameraActor ) during destruction, which attempts to kick start a size negotiation
[Solution] do not call Remove, just release the handle

Change-Id: I475f7fb17f45141ad001827db1f775a37e77eb78

dali/internal/common/core-impl.cpp
dali/internal/event/common/stage-impl.cpp

index bbd6ac3..ddc8537 100644 (file)
@@ -182,7 +182,11 @@ Core::~Core()
   // clear the thread local storage first
   // allows core to be created / deleted many times in the same thread (how TET cases work).
   // Do this before mStage.Reset() so Stage::IsInstalled() returns false
-  ThreadLocalStorage::Get().Remove();
+  ThreadLocalStorage* tls = ThreadLocalStorage::GetInternal();
+  if( tls )
+  {
+    tls->Remove();
+  }
 
   // Stop relayout requests being raised on stage destruction
   mRelayoutController.Reset();
index 31d8178..7d80c06 100644 (file)
@@ -117,7 +117,9 @@ void Stage::Uninitialize()
 
   if( mDefaultCamera )
   {
-    Remove(*(mDefaultCamera.Get()));
+    // its enough to release the handle so the object is released
+    // don't need to remove it from root actor as root actor will delete the object
+    mDefaultCamera.Reset();
   }
 
   if( mRootLayer )