<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>11523</bug_id>
          
          <creation_ts>2006-11-05 18:08:38 -0800</creation_ts>
          <short_desc>WebBaseNetscapePluginView leaks like a mofo</short_desc>
          <delta_ts>2007-01-26 21:22:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Plug-ins</component>
          <version>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P1</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Steve Gehrman">steve</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>kdecker</cc>
    
    <cc>mrowe</cc>
    
    <cc>steve</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>46822</commentid>
    <comment_count>0</comment_count>
    <who name="Steve Gehrman">steve</who>
    <bug_when>2006-11-05 18:08:38 -0800</bug_when>
    <thetext>In my app, an interactive flash swf is constantly sending info back and forth to the client app and each communication creates a stream but never releases it.  It was eating memory like crazy.

Add this to WebBaseNetscapePluginView.m

- (void)streamIsDead:(WebBaseNetscapePluginStream*)stream;
{
    [[stream retain] autorelease];
    
    // don&apos;t want to retain the stream anylonger
    [streams removeObjectIdenticalTo:stream];
}

In WebBaseNetscaplePluginStream.m add this one line to setPluginPointer....

- (void)setPluginPointer:(NPP)pluginPointer
{
    if (pluginPointer) {
        instance = pluginPointer;
        pluginView = [(WebBaseNetscapePluginView *)instance-&gt;ndata retain];
        WebNetscapePluginPackage *plugin = [pluginView plugin];
        NPP_NewStream = [plugin NPP_NewStream];
        NPP_WriteReady = [plugin NPP_WriteReady];
        NPP_Write = [plugin NPP_Write];
        NPP_StreamAsFile = [plugin NPP_StreamAsFile];
        NPP_DestroyStream = [plugin NPP_DestroyStream];
        NPP_URLNotify = [plugin NPP_URLNotify];
    } else {
        instance = NULL;
        
        [pluginView streamIsDead:self];  // &lt;-- added this line only
        
        [pluginView release];
        pluginView = nil;
        NPP_NewStream = NULL;
        NPP_WriteReady = NULL;
        NPP_Write = NULL;
        NPP_StreamAsFile = NULL;
        NPP_DestroyStream = NULL;
        NPP_URLNotify = NULL;
    }
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45744</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-11-14 22:24:46 -0800</bug_when>
    <thetext>Thank you for making the fix! It would be easier (and therefore faster) to process if you could submit it according to the guidelines from &lt;http://webkit.org/coding/contributing.html&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>45698</commentid>
    <comment_count>2</comment_count>
    <who name="Steve Gehrman">steve</who>
    <bug_when>2006-11-15 15:09:53 -0800</bug_when>
    <thetext>It would be easier and faster if you just fixed the code rather than wasting my time telling me to reformat my bug report.  It&apos;s super simple.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33334</commentid>
    <comment_count>3</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-01-22 17:09:35 -0800</bug_when>
    <thetext>Thanks for your cooperation Steve.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>33331</commentid>
    <comment_count>4</comment_count>
    <who name="Mark Rowe (bdash)">mrowe</who>
    <bug_when>2007-01-22 17:15:03 -0800</bug_when>
    <thetext>&lt;rdar://problem/4946922&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32647</commentid>
    <comment_count>5</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-25 14:14:49 -0800</bug_when>
    <thetext>Committed by kdecker in r19131.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32663</commentid>
    <comment_count>6</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-25 19:28:01 -0800</bug_when>
    <thetext>Patch backed out in r19135 because it crashes espn.com.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32159</commentid>
    <comment_count>7</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-26 19:36:40 -0800</bug_when>
    <thetext>Committed by kdecker in r19167.

http://trac.webkit.org/projects/webkit/changeset/19167

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32157</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-26 20:22:29 -0800</bug_when>
    <thetext>With a locally-built debug build of WebKit r19181 with Safari 2.0.4 (419.3) on Mac OS X 10.4.8 (8N1037), http://mail.yahoo.com/ now crashes (when you have that goofy persona-head-thingy defined):

objc: FREED(id): message destroyStreamWithError: sent to freed object=0xf487860
Trace/BPT trap

Stack trace:

Exception:  EXC_BREAKPOINT (0x0006)
Code[0]:    0x00000002
Code[1]:    0x00000000


Thread 0 Crashed:
0   libobjc.A.dylib                	0x90a5eb09 _objc_error + 86
1   libobjc.A.dylib                	0x90a5eb40 __objc_error + 45
2   libobjc.A.dylib                	0x90a5d1a0 _freedHandler + 53
3   com.apple.WebKit               	0x003132a7 -[WebBaseNetscapePluginStream cancelLoadAndDestroyStreamWithError:] + 72 (WebBaseNetscapePluginStream.m:342)
4   com.apple.WebCore              	0x0139af5b WebCore::NetscapePlugInStreamLoader::didReceiveResponse(WebCore::ResourceResponse const&amp;) + 331 (NetscapePlugInStreamLoaderMac.mm:85)
5   com.apple.WebCore              	0x013c6ced WebCore::ResourceLoader::didReceiveResponse(WebCore::ResourceHandle*, WebCore::ResourceResponse const&amp;) + 31
6   com.apple.WebCore              	0x013a698b -[WebCoreResourceHandleAsDelegate connection:didReceiveResponse:] + 115 (ResourceHandleMac.mm:340)
7   com.apple.Foundation           	0x9265e8a7 -[NSURLConnection(NSURLConnectionInternal) _sendDidReceiveResponseCallback] + 56
8   com.apple.Foundation           	0x9265ce1f -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] + 614
9   com.apple.Foundation           	0x9265cb41 _sendCallbacks + 201
10  com.apple.CoreFoundation       	0x9082afd2 CFRunLoopRunSpecific + 1213
11  com.apple.CoreFoundation       	0x9082ab0e CFRunLoopRunInMode + 61
12  com.apple.HIToolbox            	0x92ddabef RunCurrentEventLoopInMode + 285
13  com.apple.HIToolbox            	0x92dda2fd ReceiveNextEventCommon + 385
14  com.apple.HIToolbox            	0x92dda154 BlockUntilNextEventMatchingListInMode + 81
15  com.apple.AppKit               	0x9327f465 _DPSNextEvent + 572
16  com.apple.AppKit               	0x9327f056 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 137
17  com.apple.Safari               	0x00006cea 0x1000 + 23786
18  com.apple.AppKit               	0x93278ddb -[NSApplication run] + 512
19  com.apple.AppKit               	0x9326cd2f NSApplicationMain + 573
20  com.apple.Safari               	0x0005f54a 0x1000 + 386378
21  com.apple.Safari               	0x0005f471 0x1000 + 386161

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32152</commentid>
    <comment_count>9</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-26 20:31:53 -0800</bug_when>
    <thetext>(In reply to comment #8)
&gt; With a locally-built debug build of WebKit r19181 with Safari 2.0.4 (419.3) on
&gt; Mac OS X 10.4.8 (8N1037), http://mail.yahoo.com/ now crashes (when you have
&gt; that goofy persona-head-thingy defined):

That would be the head of your Yahoo! Avatar.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>32153</commentid>
    <comment_count>10</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-01-26 21:22:28 -0800</bug_when>
    <thetext>FIx for mail.yahoo.com avatar committed by ddkilzer in r19182.  Patch by Darin.

http://trac.webkit.org/projects/webkit/changeset/19182

</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>