From 929fb81b0d1c8c11fe36fbda7c008dd8a45ec098 Mon Sep 17 00:00:00 2001 From: Heeyong Song Date: Tue, 12 May 2020 14:26:44 +0900 Subject: [PATCH] Check if mGraphics is valid Change-Id: Idc8ffbfa10edb25f6d6779134e6b40c672fc6741 --- .../window-system/common/window-render-surface.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index f86d7c2..e1a344f 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -204,9 +204,10 @@ void WindowRenderSurface::GetDpi( unsigned int& dpiHorizontal, unsigned int& dpi void WindowRenderSurface::InitializeGraphics() { - mGraphics = &mAdaptor->GetGraphicsInterface(); + DALI_ASSERT_ALWAYS( mGraphics && "Graphics interface is not created" ); + auto eglGraphics = static_cast(mGraphics); mEGL = &eglGraphics->GetEglInterface(); @@ -258,13 +259,15 @@ void WindowRenderSurface::DestroySurface() DALI_LOG_TRACE_METHOD( gWindowRenderSurfaceLogFilter ); auto eglGraphics = static_cast(mGraphics); + if( eglGraphics ) + { + DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() ); - DALI_LOG_RELEASE_INFO("WindowRenderSurface::DestroySurface: WinId (%d)\n", mWindowBase->GetNativeWindowId() ); - - Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.DestroySurface( mEGLSurface ); + Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); + eglImpl.DestroySurface( mEGLSurface ); - mWindowBase->DestroyEglWindow(); + mWindowBase->DestroyEglWindow(); + } } bool WindowRenderSurface::ReplaceGraphicsSurface() -- 2.7.4