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 /WebCore | |
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 'WebCore')
-rw-r--r-- | WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 2 | ||||
-rw-r--r-- | WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp index ba9f295..72aefa4 100644 --- a/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp +++ b/WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp @@ -852,9 +852,9 @@ void GraphicsLayerAndroid::setContentsToMedia(PlatformLayer* mediaLayer) mediaLayer->setSize(m_contentLayer->getWidth(), m_contentLayer->getHeight()); mediaLayer->setDrawTransform(m_contentLayer->drawTransform()); + mediaLayer->ref(); m_contentLayer->unref(); m_contentLayer = mediaLayer; - m_contentLayer->ref(); // If the parent exists then notify it to re-sync it's children if (m_parent) { diff --git a/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h index d10e1ff..66b35dd 100644 --- a/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h +++ b/WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h @@ -99,7 +99,7 @@ public: bool supportsAcceleratedRendering() const { return true; } LayerAndroid* platformLayer() const { - return const_cast<VideoLayerAndroid*> (&m_videoLayer); + return m_videoLayer; } protected: @@ -131,7 +131,7 @@ protected: bool m_naturalSizeUnknown; bool m_isVisible; - VideoLayerAndroid m_videoLayer; + VideoLayerAndroid* m_videoLayer; }; } // namespace WebCore |