From e81731463bed439d17002741ea595c5800e87854 Mon Sep 17 00:00:00 2001 From: Teng-Hui Zhu Date: Fri, 11 Mar 2011 14:58:38 -0800 Subject: 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 --- WebCore/platform/graphics/android/GraphicsLayerAndroid.cpp | 2 +- WebCore/platform/graphics/android/MediaPlayerPrivateAndroid.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'WebCore/platform') 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 (&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 -- cgit v1.1