Closed
Bug 41988
Opened 24 years ago
Closed 24 years ago
nsViewManager2 leaks an nsDrawingSurfaceGTK on shutdown
Categories
(Core :: Web Painting, defect, P3)
Tracking
()
People
(Reporter: dbaron, Assigned: rusty.lynch)
Details
(Keywords: memory-leak, Whiteboard: [tind-mlk][need info])
Attachments
(4 files)
2.22 KB,
patch
|
Details | Diff | Splinter Review | |
6.37 KB,
patch
|
Details | Diff | Splinter Review | |
6.37 KB,
patch
|
Details | Diff | Splinter Review | |
6.40 KB,
patch
|
Details | Diff | Splinter Review |
DESCRIPTION: nsViewManager2 leaks an nsDrawingSurfaceGTK because the last release of the view manager occurs during XPCOM shutdown. During XPCOM shutdown, nsComponentManager::CreateInstance fails. This means that |rc| cannot be created in |~nsViewManager2|, so |DestroyDrawingSurface| is never called on |mDrawingSurface|. STEPS TO REPRODUCE: * use leak logging on "./mozilla -f bloaturls.txt", or look at tinderbox leak stats BUGGY ON: * Linux mozilla build of 2000-06-08 ADDITIONAL INFORMATION: You might be able to just release the drawing surfaces if you can't get a rendering context, but I'm not sure how things work on all platforms.
Updated•24 years ago
|
Status: NEW → ASSIGNED
Target Milestone: --- → M21
Reporter | ||
Updated•24 years ago
|
Whiteboard: [tind-mlk]
Assignee | ||
Comment 1•24 years ago
|
||
taking a look into this
Assignee: kmcclusk → rusty.lynch
Status: ASSIGNED → NEW
Reporter | ||
Comment 2•24 years ago
|
||
Adding previous owner back to cc: list.
Assignee | ||
Comment 3•24 years ago
|
||
Since CreateInstance denies us during shutdown, what if we add another member variable for an nsIRenderingContext that is created in the constructor. Then we could use the new member to do the DestroyDrawingSurface's. I already have it working on my tree. Is this acceptable? The additional nsIRenderingContext adds a very small about of bloat (96 bytes for the gtk version.)
Assignee | ||
Comment 4•24 years ago
|
||
Comment 5•24 years ago
|
||
Comment 6•24 years ago
|
||
I´ve attached a patch which fixes this problem using an observer upon XPCOM shutdown. It is enabled to act only when DEBUG is defined, so that it takes away the noise but doesn´t get in the way on a release version.
Keywords: patch
Comment 7•24 years ago
|
||
Reporter | ||
Comment 8•24 years ago
|
||
How is this new patch going to help? It looks like it still calls CreateInstance during XPCOM shutdown (in nsViewManager2::xpcom_shutdown).
Comment 9•24 years ago
|
||
Sure it does, but this time we are doing it _before_ closing XPCOM, so the services are still available, and we can request it. See NS_ShutdownXPCOM() ... well, at least this makes some sense, and works. This is also the explanation I got for a fix I proposed to bug #38283.
Comment 10•24 years ago
|
||
Comment 11•24 years ago
|
||
... on this one (is similar to the statics on #43656 and #43644) I have to use XPCOM (instead of a refcount, which fails) or as Rusty said, create another RC. Can we agree on a sollution to check it in?
Comment 12•24 years ago
|
||
add blizzard and pavlov. you two are the GTK gurus; what say you?
Comment 13•24 years ago
|
||
beard: got any preferences/ideas/comments? inaky: whichever mechanism we decide to use, this code should *not* be #ifdef DEBUG. how many of these objects (nsViewManager2's) get created during the life of the app? If there is only ever *one*, then let's just keep it around in a member variable to use on a rainy day. If there are >1, then I'd probably vote for the XPCOM shutdown hooks (there may be a more elegant way to do this; e.g., at the module level or something).
Comment 14•24 years ago
|
||
In a fast run using the about:blank page and shutting down, refcnt balancer reports four objects. Going to slashdot shows five.
Comment 15•24 years ago
|
||
Cc'ing Valeski. Jud could you make the call about whether this is nsbeta3 + or -? Thanks.
Whiteboard: [tind-mlk] → [tind-mlk][need info]
Comment 16•24 years ago
|
||
I checked in a fix for this bug back on 8/17/2000. If its still leaking a drawing surface, it must be for some other reason. I hold a global rendering context around just for the purpose of cleaning up the drawing surfaces. When the last viewmanager goes away the global rendering context is destroyed as well.
Comment 17•24 years ago
|
||
*** This bug has been marked as a duplicate of 48190 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
Reporter | ||
Comment 18•24 years ago
|
||
There are no nsDrawingSurfaceGTK leaks shown in the current speedracer bloat stats. If you know of leaks, please file a separate bug with steps to reproduce if one is not already filed.
Updated•6 years ago
|
Component: Layout: View Rendering → Layout: Web Painting
You need to log in
before you can comment on or make changes to this bug.
Description
•