Reviewed by Oliver.
authorandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2007 18:16:54 +0000 (18:16 +0000)
committerandersca <andersca@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 31 Aug 2007 18:16:54 +0000 (18:16 +0000)
        <rdar://problem/5423939>
        http://bugs.webkit.org/show_bug.cgi?id=15013
        ASSERTION FAILED !m_inDestructor in WebCore::Shared<WebCore::PluginStreamWin>::ref() on Windows

        Protect the stream in case it's destroyed by the plug-in.

        * plugins/win/PluginStreamWin.cpp:
        (WebCore::PluginStreamWin::didReceiveData):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@25331 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/plugins/win/PluginStreamWin.cpp

index fd65dc4..d9fd207 100644 (file)
@@ -1,3 +1,16 @@
+2007-08-31  Anders Carlsson  <andersca@apple.com>
+
+        Reviewed by Oliver.
+
+        <rdar://problem/5423939>
+        http://bugs.webkit.org/show_bug.cgi?id=15013
+        ASSERTION FAILED !m_inDestructor in WebCore::Shared<WebCore::PluginStreamWin>::ref() on Windows
+        
+        Protect the stream in case it's destroyed by the plug-in.
+        
+        * plugins/win/PluginStreamWin.cpp:
+        (WebCore::PluginStreamWin::didReceiveData):
+
 2007-08-31  Darin Adler  <darin@apple.com>
 
         Reviewed by Anders.
 2007-08-31  Darin Adler  <darin@apple.com>
 
         Reviewed by Anders.
index cfe5687..565e6ee 100644 (file)
@@ -339,6 +339,10 @@ void PluginStreamWin::didReceiveData(SubresourceLoader* loader, const char* data
     m_deliveryData->resize(oldSize + length);
     memcpy(m_deliveryData->data() + oldSize, data, length);
 
     m_deliveryData->resize(oldSize + length);
     memcpy(m_deliveryData->data() + oldSize, data, length);
 
+    // If the plug-in cancels the stream in deliverData it could be deleted, 
+    // so protect it here.
+    RefPtr<PluginStreamWin> protect(this);
+
     if (m_transferMode != NP_ASFILEONLY)
         deliverData();
 
     if (m_transferMode != NP_ASFILEONLY)
         deliverData();