[3.0] Fix crash in wayland 38/55938/2
authortaeyoon <taeyoon0.lee@samsung.com>
Wed, 30 Dec 2015 03:13:42 +0000 (12:13 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Fri, 15 Jan 2016 02:38:02 +0000 (11:38 +0900)
Change-Id: I2cd7e2990bdb9a1a674ddc3ff3cafa41d12f213f

adaptors/ecore/wayland/window-impl-ecore-wl.cpp
adaptors/ecore/wayland/window-render-surface-ecore-wl.cpp

index 0202d5f649893a686460de4f42ba494bbde852cc..e2ad5d643447418a34526747f91cc4f7c1fe5485 100644 (file)
@@ -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;
 };
 
index 532c47f52ec443805ec75fff5e08f3395e2e339a..40cd572e24633795ca9ce4cbd4ca32dc69ec088b 100644 (file)
@@ -23,7 +23,7 @@
 #include <dali/integration-api/debug.h>
 
 // INTERNAL INCLUDES
-#include <wl-types.h>
+#include <ecore-wl-types.h>
 #include <trigger-event.h>
 #include <gl/egl-implementation.h>
 #include <base/display-connection.h>
@@ -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<Internal::Adaptor::EglImplementation&>( 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 )