From b49beeb496b549a37338f16ef83b92b3dc697682 Mon Sep 17 00:00:00 2001 From: Richard Huang Date: Thu, 22 Nov 2018 11:11:23 +0000 Subject: [PATCH] Fix the crash when it tries to destroy the wrong surface Change-Id: If8a0b0527c3f6e96d97436a085405b609f01c486 --- dali/internal/adaptor/common/adaptor-impl.cpp | 1 + dali/internal/adaptor/common/combined-update-render-controller.cpp | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/dali/internal/adaptor/common/adaptor-impl.cpp b/dali/internal/adaptor/common/adaptor-impl.cpp index c39903f..d046790 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 d4a2a77..4c7b79f 100644 --- a/dali/internal/adaptor/common/combined-update-render-controller.cpp +++ b/dali/internal/adaptor/common/combined-update-render-controller.cpp @@ -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(); -- 2.7.4