Changelog: Fixed some ref handling. Index: dlls/oleaut32/typelib.c =================================================================== RCS file: /home/wine/wine/dlls/oleaut32/typelib.c,v retrieving revision 1.116 diff -u -r1.116 typelib.c --- dlls/oleaut32/typelib.c 6 Jul 2004 21:28:13 -0000 1.116 +++ dlls/oleaut32/typelib.c 10 Aug 2004 22:53:24 -0000 @@ -2460,7 +2460,6 @@ { *ppTI = MSFT_DoTypeInfo(&cx, i, pTypeLibImpl); - ITypeInfo_AddRef((ITypeInfo*) *ppTI); ppTI = &((*ppTI)->next); (pTypeLibImpl->TypeInfoCount)++; } @@ -4079,6 +4078,7 @@ ICOM_THIS( ITypeInfoImpl, iface); ++(This->ref); + ITypeLib2_AddRef((ITypeLib2*)This->pTypeLib); TRACE("(%p)->ref is %u\n",This, This->ref); return This->ref; @@ -4086,7 +4086,7 @@ /* ITypeInfo::Release */ -static ULONG WINAPI ITypeInfo_fnRelease( ITypeInfo2 *iface) +static ULONG WINAPI ITypeInfo_fnRelease(ITypeInfo2 *iface) { ICOM_THIS( ITypeInfoImpl, iface); @@ -4094,8 +4094,11 @@ TRACE("(%p)->(%u)\n",This, This->ref); - if (!This->ref) - { + if (This->ref) { + /* We don't release ITypeLib when ref=0 becouse + it means that funtion is called by ITypeLi2_Release */ + ITypeLib2_Release((ITypeLib2*)This->pTypeLib); + } else { FIXME("destroy child objects\n"); TRACE("destroying ITypeInfo(%p)\n",This);