[5.0] Fix the crash when it tries to destroy the wrong surface 39/193639/1 submit/tizen_5.0/20181122.121626
authorRichard Huang <r.huang@samsung.com>
Thu, 22 Nov 2018 11:11:23 +0000 (11:11 +0000)
committerJiyun Yang <ji.yang@samsung.com>
Thu, 22 Nov 2018 11:58:52 +0000 (20:58 +0900)
Change-Id: If8a0b0527c3f6e96d97436a085405b609f01c486

dali/internal/adaptor/common/adaptor-impl.cpp
dali/internal/adaptor/common/combined-update-render-controller.cpp

index 3a0c1f2..2cf55c1 100755 (executable)
@@ -515,6 +515,7 @@ void Adaptor::ReplaceSurface( Any nativeWindow, RenderSurface& newSurface )
 
   // Must delete the old Window only after the render thread has completed the replace
   oldDefaultWindow.surface->DestroySurface();
+  oldDefaultWindow.surface = nullptr;
 }
 
 RenderSurface& Adaptor::GetSurface() const
index 67bfd43..5ae0ecc 100755 (executable)
@@ -551,7 +551,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
-    RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+    currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
     if( currentSurface )
     {
       currentSurface->PreRender( surfaceResized );
@@ -631,6 +631,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   // Inform core of context destruction & shutdown EGL
   mCore.ContextDestroyed();
+  currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->DestroySurface();