On Thursday 2003-09-25 16:10 +0200, Ulrich von Zadow wrote:
> What happens is almost too simple and too incredible to believe it: 
> Depending on some #define-settings, nsCOMPtr will have a destructor that 
> does not make any calls to Release() when it is destroyed. In Debug 
> builds, NSCAP_FEATURE_DEBUG_PTR_TYPES is set by default. After some 
> pre-processor magic, the empty destructor in 
> http://lxr.mozilla.org/seamonkey/source/xpcom/glue/nsCOMPtr.h#402 gets 
> compiled while compiling xpcom, and somehow it gets silently used by 
> some components. Other messages in n.p.m.* lead us to believe that this 
> function is there to prevent unresolved externals. Is is supposed to be 
> called at all? What was supposed to prevent it from being called (as 
> opposed to being linked)?

This was the result of the fix to bug 77112 [1], which has been bugging
me (as I mentioned in [2]).  It allows debug and optimized code to link
with each other, but as I suspected, the code leaks.

The solution for you, if possible, is not to mix debug and non-debug
code.

I think the longer-term solution for us is to change nsCOMPtr_base so
it's the same in DEBUG and non-DEBUG builds, rename it, and leave a copy
of the old version around for binary compatibility.  Or something like
that...

-David

[1] http://bugzilla.mozilla.org/show_bug.cgi?id=77112
[2] http://bugzilla.mozilla.org/show_bug.cgi?id=217009#c2

-- 
L. David Baron                                <URL: http://dbaron.org/ >
_______________________________________________
Mozilla-xpcom mailing list
[EMAIL PROTECTED]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to