Fix the crash when it tries to destroy the wrong surface 33/193633/1
authorRichard Huang <r.huang@samsung.com>
Thu, 22 Nov 2018 11:11:23 +0000 (11:11 +0000)
committerRichard Huang <r.huang@samsung.com>
Thu, 22 Nov 2018 11:13:08 +0000 (11:13 +0000)
Change-Id: If8a0b0527c3f6e96d97436a085405b609f01c486

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

index c39903f..d046790 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 d4a2a77..4c7b79f 100644 (file)
@@ -547,7 +547,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
       }
     }
 
-    RenderSurface* currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
+    currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
     if( currentSurface )
     {
       currentSurface->PreRender( surfaceResized );
@@ -627,6 +627,7 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   // Inform core of context destruction & shutdown EGL
   mCore.ContextDestroyed();
+  currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
   if( currentSurface )
   {
     currentSurface->DestroySurface();