TypeLib containment refcounting

Mike Hearn m.hearn at signal.qinetiq.com
Tue Jun 17 09:52:30 CDT 2003

> Yes, that's what I think Alexandre's point was. An app can use
> GetTypeInfoOfGuid twice, the same typeinfo object would be returned in
> both calls, you addref the typelib twice, the app can then release that
> typeinfo twice, but with the result that the typeinfo is only destroyed
> once, so the typelib would be only released once with your patch.

Ah, I understand now. Thanks for explaining this to me.

> So, either addref the typelib only if the app does not already have
> references to the typeinfo, or easier, always release the typelib in the
> typeinfo's release whether or not it's the last reference (I'm not sure
> you'd ever get to the last reference anyway because the typelib
> structure keeps internal references to typeinfo objects too).

Yeah, I think moving the TypeLib release to the TypeInfo release method
would be the best option here. I will try and resubmit the patch in the
next couple of days.

thanks -mike

Mike Hearn <m.hearn at signal.qinetiq.com>
QinetiQ - Malvern Technology Center

More information about the wine-devel mailing list