WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
11523
WebBaseNetscapePluginView leaks like a mofo
https://bugs.webkit.org/show_bug.cgi?id=11523
Summary
WebBaseNetscapePluginView leaks like a mofo
Steve Gehrman
Reported
2006-11-05 18:08:38 PST
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'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->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]; // <-- 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; } }
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2006-11-14 22:24:46 PST
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 <
http://webkit.org/coding/contributing.html
>.
Steve Gehrman
Comment 2
2006-11-15 15:09:53 PST
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's super simple.
Mark Rowe (bdash)
Comment 3
2007-01-22 17:09:35 PST
Thanks for your cooperation Steve.
Mark Rowe (bdash)
Comment 4
2007-01-22 17:15:03 PST
<
rdar://problem/4946922
>
David Kilzer (:ddkilzer)
Comment 5
2007-01-25 14:14:49 PST
Committed by kdecker in
r19131
.
David Kilzer (:ddkilzer)
Comment 6
2007-01-25 19:28:01 PST
Patch backed out in
r19135
because it crashes espn.com.
David Kilzer (:ddkilzer)
Comment 7
2007-01-26 19:36:40 PST
Committed by kdecker in
r19167
.
http://trac.webkit.org/projects/webkit/changeset/19167
David Kilzer (:ddkilzer)
Comment 8
2007-01-26 20:22:29 PST
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&) + 331 (NetscapePlugInStreamLoaderMac.mm:85) 5 com.apple.WebCore 0x013c6ced WebCore::ResourceLoader::didReceiveResponse(WebCore::ResourceHandle*, WebCore::ResourceResponse const&) + 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
David Kilzer (:ddkilzer)
Comment 9
2007-01-26 20:31:53 PST
(In reply to
comment #8
)
> 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):
That would be the head of your Yahoo! Avatar.
David Kilzer (:ddkilzer)
Comment 10
2007-01-26 21:22:28 PST
FIx for mail.yahoo.com avatar committed by ddkilzer in
r19182
. Patch by Darin.
http://trac.webkit.org/projects/webkit/changeset/19182
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug