OSDN Git Service

Fix the crash of exiting full screen by checking null.
authorGrace Kloba <klobag@google.com>
Thu, 21 Jan 2010 02:19:19 +0000 (18:19 -0800)
committerGrace Kloba <klobag@google.com>
Thu, 21 Jan 2010 02:19:19 +0000 (18:19 -0800)
When we exit full screen, we place the embedded
view on the screen, so we need to destroy it again
in the destructor

WebKit/android/jni/WebViewCore.cpp
WebKit/android/plugins/PluginWidgetAndroid.cpp

index a1f4354..8f5cc45 100644 (file)
@@ -3288,7 +3288,8 @@ static void FullScreenPluginHidden(JNIEnv* env, jobject obj, jint npp)
 {
     WebViewCore* viewImpl = GET_NATIVE_VIEW(env, obj);
     PluginWidgetAndroid* plugin = viewImpl->getPluginWidget((NPP)npp);
-    plugin->exitFullScreen(false);
+    if (plugin)
+        plugin->exitFullScreen(false);
 }
 
 static WebCore::IntRect jrect_to_webrect(JNIEnv* env, jobject obj)
index 7a4b9a3..ac668d7 100644 (file)
@@ -65,7 +65,8 @@ PluginWidgetAndroid::~PluginWidgetAndroid() {
         m_core->removePlugin(this);
         if (m_isFullScreen) {
             exitFullScreen(true);
-        } else if (m_embeddedView) {
+        }
+        if (m_embeddedView) {
             m_core->destroySurface(m_embeddedView);
         }
     }