Closed
Bug 196797
Opened 21 years ago
Closed 21 years ago
[FIXr]Make imgRequestProxy hold a weak ref to the decoder observer
Categories
(Core :: Graphics: ImageLib, defect, P1)
Tracking
()
VERIFIED
FIXED
mozilla1.4alpha
People
(Reporter: bzbarsky, Assigned: bzbarsky)
References
Details
(Keywords: memory-leak)
Attachments
(1 file, 2 obsolete files)
15.41 KB,
patch
|
pavlov
:
review+
|
Details | Diff | Splinter Review |
This is basically to prevent reference cycles... As things stand, nsImageDocument was only not leaking because of explicit "set the request to null on document unload" code. nsImageLoader was leaking (so all background images got leaked, for example; this includes all list-style-image images in XUL, of course). nsImageLoadingContent would have had to put in a bunch of code to not leak... I think that this change is a decent way to resolve the issue -- it puts the ownership in the caller's hands. I don't much like the refcounting in nsTreeBodyFrame, but that code was already pretty broken (passing a refcount-0 object through an XPCOM interface and all...); if desired, I can muck with it a bit to store both the imgIRequest and the listener in the cache entry....
Assignee | ||
Updated•21 years ago
|
Priority: -- → P1
Summary: Make imgRequestProxy hold a weak ref to the decoder observer → [FIX]Make imgRequestProxy hold a weak ref to the decoder observer
Target Milestone: --- → mozilla1.4alpha
Assignee | ||
Comment 1•21 years ago
|
||
Assignee | ||
Comment 2•21 years ago
|
||
Comment on attachment 116827 [details] [diff] [review] Surpsingly many callers already Canceled the request properly... jst, can you get to this review in the next few days? Or are you busy? If the latter, who'd be a good sr for this? peterv?
Attachment #116827 -
Flags: superreview?(jst)
Attachment #116827 -
Flags: review?(pavlov)
Assignee | ||
Comment 3•21 years ago
|
||
Erm, that should be: + NS_ASSERTION(observer, "No observer? We're leaking!"); instead of + NS_ASSERTION(observer, "No observer? We're leaking!\n"); (fixed in my tree).
Comment 4•21 years ago
|
||
Comment on attachment 116827 [details] [diff] [review] Surpsingly many callers already Canceled the request properly... - In nsImageDocument::SetScriptGlobalObject(): + mImageRequest->Cancel(NS_ERROR_FAILURE); I don't see any code that guarantees that mImageRequest is non-null here, a null check seems appropriate here. sr=jst with that change.
Attachment #116827 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 5•21 years ago
|
||
Assignee | ||
Comment 6•21 years ago
|
||
Comment on attachment 117042 [details] [diff] [review] I missed a spot; this patch is in addition to the other one Here's hoping for some review love from pavlov....
Attachment #117042 -
Flags: superreview?(jst)
Attachment #117042 -
Flags: review?(pavlov)
Comment 7•21 years ago
|
||
Comment on attachment 117042 [details] [diff] [review] I missed a spot; this patch is in addition to the other one sr=jst
Attachment #117042 -
Flags: superreview?(jst) → superreview+
Assignee | ||
Comment 8•21 years ago
|
||
Attachment #116827 -
Attachment is obsolete: true
Attachment #117042 -
Attachment is obsolete: true
Updated•21 years ago
|
Attachment #117451 -
Flags: review+
Assignee | ||
Updated•21 years ago
|
Summary: [FIX]Make imgRequestProxy hold a weak ref to the decoder observer → [FIXr]Make imgRequestProxy hold a weak ref to the decoder observer
Assignee | ||
Updated•21 years ago
|
Attachment #117042 -
Flags: review?(pavlov)
Assignee | ||
Updated•21 years ago
|
Attachment #116827 -
Flags: review?(pavlov)
Assignee | ||
Comment 9•21 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•