Last Comment Bug 81938 - nsFontPackageService does not release a listener implementing nsIFontPackageHandler ?
: nsFontPackageService does not release a listener implementing nsIFontPackageH...
Status: RESOLVED INVALID
: embed, intl
Product: Core
Classification: Components
Component: Embedding: APIs (show other bugs)
: Trunk
: x86 All
: -- normal (vote)
: mozilla0.9.2
Assigned To: Roy Yokoyama
: Michael Dunn
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2001-05-21 09:11 PDT by Hansoo Kim
Modified: 2001-09-10 00:22 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Hansoo Kim 2001-05-21 09:11:38 PDT
A listener to nsFontPackageService does not get released when an embedder
exits out.

Step to reproduce :
1) Implement a class exposing nsIFontPackageHandler interface.
2) When app starts up, hook it up to nsFontPackageService in such a way
   that only ref cnt on the object is from nsFontPackageService.
3) Make sure the listener gets a notification by going into web site which
   needs a font not installed in your system.
   (  Currently only supports Korean, Japanese, and Chinese. )
4) Exit out of app, and test if the destructor of the object is called or not.
Comment 1 Adam Lock 2001-05-25 05:21:47 PDT
The nsFontPackageService stores the handler in a smart pointer so it should 
always release the handler when it is destroyed. See:

http://lxr.mozilla.org/seamonkey/source/intl/locale/src/nsFontPackageService.h#2
9

So that means:

a) The nsFontPackageService is not being destroyed itself (so it won't release 
the handler), either because someone still holds a reference to it or the 
services are not being destroyed.
b) Your handler has an extra refcount on it.

Would you be able to test for a) by putting a breakpoint on its destructor and 
for b) by checked the refcount on your object before and after setting the 
handler on the font package service?
Comment 2 Roy Yokoyama 2001-05-25 13:34:28 PDT
Here is the test on Mozilla
a) by putting a breakpoint on its destructor
     I put breakpoints on constructor and destructor of both 
     nsFontPackageService and nsFontPackageHandler and verified
     that the destructors are getting called on respective objects.

b) by checked the refcount on your object before and after setting 
   the handler on the font package service?
     mRefCnt of nsFontPackageHandler was 1.

adam : Please assign this bug to me. I have been reviewing Hansoo's code
and I am familiar with his implementation.
Comment 3 Adam Lock 2001-05-27 08:54:38 PDT
Reassigning
Comment 4 Roy Yokoyama 2001-05-30 18:30:45 PDT
hansoo: any progress from my last suggestion on your code?
Comment 5 Frank Tang 2001-06-05 14:24:15 PDT
hansoodev@yahoo.com
I think this is an invalid bug. Please talk to yokoyama in private email about 
your code. 

Note You need to log in before you can comment on or make changes to this bug.