summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/plugins/PluginStream.cpp
diff options
context:
space:
mode:
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);