Add pointer test on IMFcontext before use pointer. 86/13986/4
authorBaptiste DURAND <baptiste.durand@open.eurogiciel.org>
Thu, 19 Dec 2013 14:30:01 +0000 (15:30 +0100)
committerJoone Hur <joone.hur@intel.com>
Tue, 14 Jan 2014 00:52:40 +0000 (16:52 -0800)
Sometime when the virtual keyboard is supposed to appear, webkit tries to use a NULL pointer as context.

Change-Id: Ic723726b6f0859c2ca9739fcaa32d243a379366e
Signed-off-by: Baptiste DURAND <baptiste.durand@open.eurogiciel.org>
Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp

index 5c25dc7..31300a6 100755 (executable)
@@ -310,11 +310,14 @@ PassOwnPtr<Ecore_IMF_Context> InputMethodContextEfl::createIMFContext(Evas* canv
 
 void InputMethodContextEfl::handleMouseUpEvent(const Evas_Event_Mouse_Up*)
 {
-    ecore_imf_context_reset(m_context.get());
+    resetIMFContext();
 }
 
 void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEvent, bool* isFiltered)
 {
+    if (!m_context)
+        return;
+
     Ecore_IMF_Event inputMethodEvent;
     ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(downEvent), &inputMethodEvent.key_down);
 
@@ -407,6 +410,10 @@ void InputMethodContextEfl::setIMFContext(Ecore_IMF_Input_Panel_Layout layout, c
     if (m_contextList.contains(layout)) {
         revertIMFContext();
         m_context = m_contextList.take(layout);
+        if (!m_context) {
+            m_context = createIMFContext(evas_object_evas_get(m_viewImpl->view()));
+            initializeIMFContext(m_context.get(), layout);
+        }
     } else if (!m_context || ecore_imf_context_input_panel_layout_get(m_context.get()) != layout) {
         OwnPtr<Ecore_IMF_Context> context = createIMFContext(evas_object_evas_get(m_viewImpl->view()));
         if (m_context)