On Wed, 01 Dec 2004 22:13:23 -0500, James Hawkins wrote:
>  ULONG WINAPI IDirectMusicChordMapImpl_IUnknown_AddRef (LPUNKNOWN iface) {
>       ICOM_THIS_MULTI(IDirectMusicChordMapImpl, UnknownVtbl, iface);
> -     TRACE("(%p): AddRef from %ld\n", This, This->ref);
> -     return ++(This->ref);
> +     TRACE("(%p): AddRef\n", This);
> +     
> +     LockModule();
> +     
> +     return 2; /* non-heap based object */
>  }

What makes you think this is a non-heap object? Almost all COM objects are
heap based except classfactories and process-wide singletons (internal to
COM typically). 

In particular this one maintains its own ref count. You shouldn't be
modifying the way objects to refcounting, you should just be adding the
LockModule/UnlockModule calls.


Reply via email to