X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dali%2Finternal%2Fwindow-system%2Fcommon%2Fwindow-render-surface.cpp;h=c95d5082e5dafb13b2827cabdcd4f184c9c0e566;hb=8786ea8fbb26a9cb555a613518cf108017467c69;hp=f86d7c2deaf5fde40a9c3a84550bf79e8115a04b;hpb=54fd2fdd37c254eeb9764bd5ac4d8f63b43c042c;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git diff --git a/dali/internal/window-system/common/window-render-surface.cpp b/dali/internal/window-system/common/window-render-surface.cpp index f86d7c2..c95d508 100644 --- a/dali/internal/window-system/common/window-render-surface.cpp +++ b/dali/internal/window-system/common/window-render-surface.cpp @@ -85,11 +85,6 @@ WindowRenderSurface::~WindowRenderSurface() { delete mRotationTrigger; } - - if ( mEGLSurface ) - { - DestroySurface(); - } } void WindowRenderSurface::Initialize( Any surface ) @@ -204,9 +199,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 +254,21 @@ 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(); - Internal::Adaptor::EglImplementation& eglImpl = eglGraphics->GetEglImplementation(); - eglImpl.DestroySurface( mEGLSurface ); + eglImpl.DestroySurface( mEGLSurface ); + mEGLSurface = nullptr; - mWindowBase->DestroyEglWindow(); + // Destroy context also + eglImpl.DestroyContext( mEGLContext ); + mEGLContext = nullptr; + + mWindowBase->DestroyEglWindow(); + } } bool WindowRenderSurface::ReplaceGraphicsSurface()