From: KwangYong Choi Date: Thu, 13 Jun 2013 09:58:57 +0000 (+0900) Subject: Fix crash when the app is terminated while color picker is shown X-Git-Tag: submit/tizen_2.2/20130714.131554~150 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;ds=sidebyside;h=2d559e1cad41b6fcb7c546f558aeec3518898f06;p=framework%2Fweb%2Fwebkit-efl.git Fix crash when the app is terminated while color picker is shown [Title] Fix crash when the app is terminated while color picker is shown [Issue#] N_SE-41001 [Problem] Crash when the apps terminated while color picker is shown [Cause] Color picker resource is not accessible during destruction time. [Solution] Close color picker before the page is destructed. Change-Id: I5bfe69292ca17c55c8f5531b2563b921084329d3 --- diff --git a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp index f6ab7eb..891e639 100644 --- a/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp +++ b/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp @@ -864,6 +864,11 @@ static void _ewk_view_smart_del(Evas_Object* ewkView) #if ENABLE(TIZEN_SCREEN_READER) ScreenReaderProxy::screenReader().disable(smartData->priv); #endif +#if ENABLE(TIZEN_INPUT_COLOR_PICKER) + // Close color picker if it's opened. + if (smartData && smartData->priv && smartData->priv->inputPicker->isColorPickerShown()) + ewk_view_color_picker_color_set(ewkView, 0, 0, 0, 0); +#endif if (smartData && smartData->priv) _ewk_view_impl_del(smartData->priv); diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp b/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp index bd21fe1..7a592f5 100755 --- a/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp +++ b/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp @@ -65,6 +65,9 @@ InputPicker::InputPicker(Evas_Object* ewkView) : m_ewkView(ewkView) , m_pickerLayout(0) , m_dataList(0) +#if ENABLE(TIZEN_INPUT_COLOR_PICKER) + , m_isColorPickerShown(false) +#endif { } @@ -283,11 +286,13 @@ void InputPicker::hideDataList(Ewk_Input_Type inputType) #if ENABLE(TIZEN_INPUT_COLOR_PICKER) void InputPicker::showColorPicker(int r, int g, int b, int) { + m_isColorPickerShown = true; ewk_color_popup(r, g, b); } void InputPicker::hideColorPicker() { + m_isColorPickerShown = false; if (!m_pickerLayout) return; diff --git a/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h b/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h index cb8d9d0..ec4cb06 100644 --- a/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h +++ b/Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h @@ -78,6 +78,7 @@ namespace WebKit { #if ENABLE(TIZEN_INPUT_COLOR_PICKER) void showColorPicker(int, int, int, int); void hideColorPicker(); + bool isColorPickerShown() { return m_isColorPickerShown; } #endif void ewk_date_popup(const char*); @@ -101,6 +102,9 @@ namespace WebKit { Evas_Object* m_ewkView; Input_Picker_Layout* m_pickerLayout; Eina_List* m_dataList; +#if ENABLE(TIZEN_INPUT_COLOR_PICKER) + bool m_isColorPickerShown; +#endif }; } // namespace WebKit