Fix crash when the app is terminated while color picker is shown
authorKwangYong Choi <ky0.choi@samsung.com>
Thu, 13 Jun 2013 09:58:57 +0000 (18:58 +0900)
committerGerrit Code Review <gerrit@gerrit.vlan144.tizendev.org>
Thu, 13 Jun 2013 10:41:16 +0000 (10:41 +0000)
[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

Source/WebKit2/UIProcess/API/efl/ewk_view.cpp
Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.cpp
Source/WebKit2/UIProcess/API/efl/tizen/InputPicker.h

index f6ab7eb..891e639 100644 (file)
@@ -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);
 
index bd21fe1..7a592f5 100755 (executable)
@@ -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;
 
index cb8d9d0..ec4cb06 100644 (file)
@@ -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