From 18e20762d22e38c4e6ddffa9cfd53e1b14ce3c2c Mon Sep 17 00:00:00 2001 From: taeyoon Date: Wed, 28 Oct 2015 14:46:51 +0900 Subject: [PATCH] Revert "Revert "[3.0] Fix crash in wayland"" This reverts commit 8109a5fc49750c6d66dc170aa3795b4b263f362a. Change-Id: Iaa3ef3e79ebcdab6df92885c73f95ec83552bf6c --- adaptors/tizen/framework-tizen.cpp | 8 ++++++-- adaptors/wayland/window-impl-wl.cpp | 2 ++ adaptors/wayland/window-render-surface-wl.cpp | 18 ++++++++++++++---- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/adaptors/tizen/framework-tizen.cpp b/adaptors/tizen/framework-tizen.cpp index 6dd9cb0..d6833f5 100644 --- a/adaptors/tizen/framework-tizen.cpp +++ b/adaptors/tizen/framework-tizen.cpp @@ -26,6 +26,7 @@ #ifdef OVER_TIZEN_SDK_2_2 #include #include +#include #endif #include @@ -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); @@ -315,6 +314,7 @@ void Framework::Run() { DALI_LOG_ERROR("Framework::Run(), ui_app_main() is failed. err = %d", ret); } + #endif mRunning = false; @@ -322,7 +322,11 @@ void Framework::Run() void Framework::Quit() { +#ifndef OVER_TIZEN_SDK_2_2 app_efl_exit(); +#else + ui_app_exit(); +#endif } bool Framework::IsMainLoopRunning() diff --git a/adaptors/wayland/window-impl-wl.cpp b/adaptors/wayland/window-impl-wl.cpp index fc325ed..c3811f5 100644 --- a/adaptors/wayland/window-impl-wl.cpp +++ b/adaptors/wayland/window-impl-wl.cpp @@ -63,6 +63,8 @@ struct Window::EventHandler */ EventHandler( Window* window ) : mWindow( window ), + mWindowPropertyHandler( NULL ), + mClientMessagehandler( NULL ), mEcoreWindow( 0 ) { } diff --git a/adaptors/wayland/window-render-surface-wl.cpp b/adaptors/wayland/window-render-surface-wl.cpp index 38a2d44..77657e7 100644 --- a/adaptors/wayland/window-render-surface-wl.cpp +++ b/adaptors/wayland/window-render-surface-wl.cpp @@ -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( 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( egl ); -- 2.7.4