summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
diff options
context:
space:
mode:
authorAlexis Menard <alexis.menard@nokia.com>2009-12-07 13:55:23 +0100
committerAlexis Menard <alexis.menard@nokia.com>2009-12-07 13:55:23 +0100
commit211c0a1dd5c10c60c3383748b13e17e6bdeaea54 (patch)
tree268920a5f40744663dd4bf8d405d35d324926f95 /src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
parentfd44f52df9275e717292f5c7e90015fc9bf14603 (diff)
parent35a740fa663d4669a45ada9c37c46546e59bbb82 (diff)
Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into widgets-ng
Diffstat (limited to 'src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
index d2d5d3c0a..cd9f83dbd 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
@@ -248,6 +248,11 @@ void PluginStream::destroyStream()
bool newStreamCalled = m_stream.ndata;
+ // Protect from destruction if:
+ // NPN_DestroyStream is called from NPP_NewStream or
+ // PluginStreamClient::streamDidFinishLoading() removes the last reference
+ RefPtr<PluginStream> protect(this);
+
if (newStreamCalled) {
if (m_reason == NPRES_DONE && (m_transferMode == NP_ASFILE || m_transferMode == NP_ASFILEONLY)) {
ASSERT(!m_path.isNull());
@@ -281,9 +286,6 @@ void PluginStream::destroyStream()
m_loader->setDefersLoading(true);
if (!newStreamCalled && m_quirks.contains(PluginQuirkFlashURLNotifyBug) &&
equalIgnoringCase(m_resourceRequest.httpMethod(), "POST")) {
- // Protect the stream if NPN_DestroyStream is called from NPP_NewStream
- RefPtr<PluginStream> protect(this);
-
m_transferMode = NP_NORMAL;
m_stream.url = "";
m_stream.notifyData = m_notifyData;
@@ -303,8 +305,6 @@ void PluginStream::destroyStream()
m_streamState = StreamStopped;
- // streamDidFinishLoading can cause us to be deleted.
- RefPtr<PluginStream> protect(this);
if (!m_loadManually)
m_client->streamDidFinishLoading(this);