[3.0] Fix crash in wayland 59/44259/2 accepted/tizen/mobile/20150720.122129 accepted/tizen/tv/20150720.122233 accepted/tizen/wearable/20150720.122313 submit/tizen/20150720.100839
authortaeyoon <taeyoon0.lee@samsung.com>
Mon, 20 Jul 2015 09:29:23 +0000 (18:29 +0900)
committertaeyoon <taeyoon0.lee@samsung.com>
Mon, 20 Jul 2015 09:35:06 +0000 (18:35 +0900)
Change-Id: I5fb6c065aed64736ca5059beac5b70a22e6f8a1c

adaptors/tizen/framework-tizen.cpp
adaptors/wayland/window-impl-wl.cpp
adaptors/wayland/window-render-surface-wl.cpp

index 1eef794..498c2a9 100644 (file)
@@ -26,6 +26,7 @@
 #ifdef OVER_TIZEN_SDK_2_2
 #include <system_info.h>
 #include <app_control_internal.h>
+#include <bundle_internal.h>
 #endif
 
 #include <dali/integration-api/debug.h>
@@ -90,8 +91,6 @@ struct Framework::Impl
 #else
     mEventCallback.app_control = AppControl;
 
-    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_BATTERY], APP_EVENT_LOW_BATTERY, AppBatteryLow, data);
-    ui_app_add_event_handler(&handlers[APP_EVENT_LOW_MEMORY], APP_EVENT_LOW_MEMORY, AppMemoryLow, data);
     ui_app_add_event_handler(&handlers[APP_EVENT_DEVICE_ORIENTATION_CHANGED], APP_EVENT_DEVICE_ORIENTATION_CHANGED, AppDeviceRotated, data);
     ui_app_add_event_handler(&handlers[APP_EVENT_LANGUAGE_CHANGED], APP_EVENT_LANGUAGE_CHANGED, AppLanguageChanged, data);
     ui_app_add_event_handler(&handlers[APP_EVENT_REGION_FORMAT_CHANGED], APP_EVENT_REGION_FORMAT_CHANGED, AppRegionChanged, data);
@@ -309,6 +308,7 @@ void Framework::Run()
   {
     DALI_LOG_ERROR("Framework::Run(), ui_app_main() is failed. err = %d", ret);
   }
+
 #endif
 
   mRunning = false;
@@ -316,7 +316,11 @@ void Framework::Run()
 
 void Framework::Quit()
 {
+#ifndef OVER_TIZEN_SDK_2_2
   app_efl_exit();
+#else
+  ui_app_exit();
+#endif
 }
 
 bool Framework::IsMainLoopRunning()
index 1cef07a..5633d64 100644 (file)
@@ -63,6 +63,8 @@ struct Window::EventHandler
    */
   EventHandler( Window* window )
   : mWindow( window ),
+    mWindowPropertyHandler( NULL ),
+    mClientMessagehandler( NULL ),
     mEcoreWindow( 0 )
   {
     // store ecore window handle
index fc171eb..8a655c0 100644 (file)
@@ -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 );
@@ -113,15 +120,18 @@ void WindowRenderSurface::DestroyEglSurface( EglInterface& eglIf )
 
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( eglIf );
   eglImpl.DestroySurface();
-  wl_egl_window_destroy(mEglWindow);
-  mEglWindow = NULL;
 }
 
 bool WindowRenderSurface::ReplaceEGLSurface( EglInterface& egl )
 {
   DALI_LOG_TRACE_METHOD( gRenderSurfaceLogFilter );
 
-  wl_egl_window_destroy(mEglWindow);
+  if( mEglWindow != NULL )
+  {
+    wl_egl_window_destroy(mEglWindow);
+    mEglWindow = NULL;
+  }
+
   mEglWindow = wl_egl_window_create(ecore_wl_window_surface_get(mWlWindow), mPosition.width, mPosition.height);
 
   Internal::Adaptor::EglImplementation& eglImpl = static_cast<Internal::Adaptor::EglImplementation&>( egl );