Closed Bug 65150 Opened 24 years ago Closed 24 years ago

leaking nsPrintOptions

Categories

(Core :: Printing: Output, defect)

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: dbaron, Assigned: dcone)

Details

(Keywords: memory-leak, Whiteboard: [tind-mlk])

Attachments

(3 files)

done's checkin on 2001-11-01 14:14 or 14:17 caused an nsPrintOptions object to
show up on the tinderbox leak stats.
Keywords: mlk
Whiteboard: [tind-mlk]
I will fix my bug, but I will leave all the rest of the cleanup to the module 
owner of nsAppRunner.cpp.
Hmmm.   Registering services in nsViewerApp / nsAppRunner seems like the
wrong thing to do.  Why isn't being listed in CreateInstance/components in
gfx/src/{mac,windows,gtk}/nsGfxFactory{Mac,Windows,GTK}.cpp enough?  Isn't
what's enough for CreateInstance enough for GetService?  See
http://lxr.mozilla.org/mozilla/source/xpcom/doc/xpcom-brownbag-1.html
http://lxr.mozilla.org/mozilla/source/xpcom/doc/xpcom-code-faq.html#ComponentManager%20Vs%20ServiceManager
dcone: no problem :-)
Could you explain why you need this RegisterService call at all.  I don't see
why.  Taking it out of nsAppRunner/nsViewerApp would also fix the leak.  (And do
you have the same leak in both places?)
David, because we wanted this to be a singleton accessible from more than just 
GFX.
I read the documents you pointed at and I believe we fulfill those requirments.

I don't think you need to call RegisterService to get that to happen.  You
shouldn't need to change nsAppRunner to make that kind of change.  The
ServiceManager will call CreateInstance for you.  I think you only need to use
RegisterService if:
 * the ServiceManager can't call CreateInstance
 * you want to override the object that would be created by CreateInstance
Ok.. that would be great actually.. let me do some research and I will get it to 
the right thing..
The above patch fixes the leak by taking the RegisterService of the 
nsIPrintOptions out.  I confirmed that a singleton will still be constructed.
Thanks for the help Dave..
sr=buster
r=dbaron on that, although you should also do the same for viewer
I did not start the service for viewer.. so nothing needs to be done there.
Um...ok, I guess I'll just let viewer be weird since it looks weird already...

jag:  Are you going to file another bug on that cleanup?
Yeah, bug 65660.
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Checked in the fix.
verified tha tthe patch went in in version 1.256 in lxr.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: