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