Delete multiple surfaces when the updated thread is destroyed
[platform/core/uifw/dali-adaptor.git] / dali / internal / adaptor / common / combined-update-render-controller.cpp
index 5c5840a..75d469c 100644 (file)
@@ -796,11 +796,15 @@ void CombinedUpdateRenderController::UpdateRenderThread()
 
   // Inform core of context destruction
   mCore.ContextDestroyed();
-  currentSurface = mAdaptorInterfaces.GetRenderSurfaceInterface();
-  if( currentSurface )
+
+  WindowContainer windows;
+  mAdaptorInterfaces.GetWindowContainerInterface( windows );
+
+  // Destroy surfaces
+  for( auto&& window : windows )
   {
-    currentSurface->DestroySurface();
-    currentSurface = nullptr;
+    Dali::RenderSurfaceInterface* surface = window->GetSurface();
+    surface->DestroySurface();
   }
 
   // Shutdown EGL