diff options
author | Teng-Hui Zhu <ztenghui@google.com> | 2011-03-11 14:58:38 -0800 |
---|---|---|
committer | Teng-Hui Zhu <ztenghui@google.com> | 2011-03-11 15:09:00 -0800 |
commit | e81731463bed439d17002741ea595c5800e87854 (patch) | |
tree | 49efe41aa838b888531e260fc1e95ff75a2417f1 /WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | |
parent | cc2679391d89b57997f78365d54d99c9ae062db3 (diff) | |
download | external_webkit-e81731463bed439d17002741ea595c5800e87854.zip external_webkit-e81731463bed439d17002741ea595c5800e87854.tar.gz external_webkit-e81731463bed439d17002741ea595c5800e87854.tar.bz2 |
Fix a crash caused by the wrong destruction handling
The VideoLayer is ref counted, so unref at the destrutor is the right way.
Don't do a deletion.
bug: 4072630
Change-Id: I1da4ec138ef119b1d8dd7700fef36bab4df55064
Diffstat (limited to 'WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp')
-rw-r--r-- | WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp index 2203ae2..e628ea1 100644 --- a/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp +++ b/WebKit/android/WebCoreSupport/MediaPlayerPrivateAndroid.cpp @@ -72,6 +72,8 @@ struct MediaPlayerPrivate::JavaGlue { MediaPlayerPrivate::~MediaPlayerPrivate() { + // m_videoLayer is reference counted, unref is enough here. + m_videoLayer->unref(); if (m_glue->m_javaProxy) { JNIEnv* env = JSC::Bindings::getJNIEnv(); if (env) { @@ -150,7 +152,8 @@ MediaPlayerPrivate::MediaPlayerPrivate(MediaPlayer* player) m_poster(0), m_naturalSize(100, 100), m_naturalSizeUnknown(true), - m_isVisible(false) + m_isVisible(false), + m_videoLayer(new VideoLayerAndroid()) { } @@ -211,7 +214,7 @@ public: jstring jUrl = wtfStringToJstring(env, m_url); env->CallVoidMethod(m_glue->m_javaProxy, m_glue->m_play, jUrl, static_cast<jint>(m_currentTime * 1000.0f), - m_videoLayer.uniqueId()); + m_videoLayer->uniqueId()); env->DeleteLocalRef(jUrl); checkException(env); |