From: taeyoon Date: Wed, 30 Dec 2015 03:13:42 +0000 (+0900) Subject: [3.0] Fix crash in wayland X-Git-Tag: accepted/tizen/common/20160208.162637~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=21c083bc22a013a441e243175795c314ec295046;p=platform%2Fcore%2Fuifw%2Fdali-adaptor.git [3.0] Fix crash in wayland Change-Id: I2cd7e2990bdb9a1a674ddc3ff3cafa41d12f213f --- diff --git a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp index 0202d5f..e2ad5d6 100644 --- a/adaptors/ecore/wayland/window-impl-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-impl-ecore-wl.cpp @@ -63,6 +63,8 @@ struct Window::EventHandler */ EventHandler( Window* window ) : mWindow( window ), + mWindowPropertyHandler( NULL ), + mClientMessageHandler( NULL ), mEcoreWindow( 0 ) { } @@ -76,9 +78,9 @@ struct Window::EventHandler { ecore_event_handler_del( mWindowPropertyHandler ); } - if ( mClientMessagehandler ) + if ( mClientMessageHandler ) { - ecore_event_handler_del( mClientMessagehandler ); + ecore_event_handler_del( mClientMessageHandler ); } } @@ -99,7 +101,7 @@ struct Window::EventHandler // Data Window* mWindow; Ecore_Event_Handler* mWindowPropertyHandler; - Ecore_Event_Handler* mClientMessagehandler; + Ecore_Event_Handler* mClientMessageHandler; Ecore_Wl_Window* mEcoreWindow; }; diff --git a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp index 532c47f..40cd572 100644 --- a/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp +++ b/adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp @@ -23,7 +23,7 @@ #include // INTERNAL INCLUDES -#include +#include #include #include #include @@ -50,7 +50,8 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, const std::string& name, bool isTransparent) : EcoreWlRenderSurface( positionSize, surface, name, isTransparent ), - mNeedToApproveDeiconify(false) + mEglWindow( NULL ), + mNeedToApproveDeiconify( false ) { DALI_LOG_INFO( gRenderSurfaceLogFilter, Debug::Verbose, "Creating Window\n" ); Init( surface ); @@ -58,6 +59,12 @@ WindowRenderSurface::WindowRenderSurface( Dali::PositionSize positionSize, WindowRenderSurface::~WindowRenderSurface() { + if( mEglWindow != NULL ) + { + wl_egl_window_destroy(mEglWindow); + mEglWindow = NULL; + } + if( mOwnSurface ) { ecore_wl_window_free( mWlWindow ); @@ -123,8 +130,12 @@ void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf ) Internal::Adaptor::EglImplementation& eglImpl = static_cast( eglIf ); eglImpl.DestroySurface(); - wl_egl_window_destroy(mEglWindow); - mEglWindow = NULL; + + if( mEglWindow != NULL ) + { + wl_egl_window_destroy(mEglWindow); + mEglWindow = NULL; + } } bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )