From: Richard Huang Date: Thu, 22 Nov 2018 11:11:23 +0000 (+0000) Subject: [5.0] Fix the crash when it tries to destroy the wrong surface X-Git-Tag: submit/tizen_5.0/20181122.121626^0 X-Git-Url: http://review.tizen.org/git/?p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git;a=commitdiff_plain;h=ada40f512d38bd93635834a2bf1110fc2e784ce2 [5.0] Fix the crash when it tries to destroy the wrong surface Change-Id: If8a0b0527c3f6e96d97436a085405b609f01c486 --- diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index 3a0c1f2..2cf55c1 100755 --- a/dali/internal/adaptor/common/adaptor-impl.cpp +++ b/dali/internal/adaptor/common/adaptor-impl.cpp @@ -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 diff --git a/dali/internal/adaptor/common/combined-update-render-controller.cpp b/dali/internal/adaptor/common/combined-update-render-controller.cpp index 67bfd43..5ae0ecc 100755 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -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();