wshom.ocx: Properly update typeinfo refcount

Alexandre Julliard julliard at winehq.org
Wed Nov 28 08:43:37 CST 2012


Nikolay Sivov <nsivov at codeweavers.com> writes:

> @@ -137,8 +137,13 @@ static HRESULT WINAPI WshCollection_GetTypeInfoCount(IWshCollection *iface, UINT
>  static HRESULT WINAPI WshCollection_GetTypeInfo(IWshCollection *iface, UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
>  {
>      WshCollection *This = impl_from_IWshCollection(iface);
> +    HRESULT hr;
> +
>      TRACE("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
> -    return get_typeinfo(IWshCollection_tid, ppTInfo);
> +
> +    hr = get_typeinfo(IWshCollection_tid, ppTInfo);
> +    ITypeInfo_AddRef(*ppTInfo);
> +    return hr;

You'd need to check for error first, but the AddRef should really be in
get_typeinfo().

-- 
Alexandre Julliard
julliard at winehq.org



More information about the wine-devel mailing list