A listener to nsFontPackageService does not get released when an embedder
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.
The nsFontPackageService stores the handler in a smart pointer so it should
always release the handler when it is destroyed. See:
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?
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.
hansoo: any progress from my last suggestion on your code?
I think this is an invalid bug. Please talk to yokoyama in private email about