[PATCH] Remove potential reference count races

Nikolay Sivov bunglehead at gmail.com
Sun Oct 28 02:13:28 CDT 2012


On 10/28/2012 04:59, max at mtew.isa-geek.net wrote:
> From: Max TenEyck Woodbury <max at mtew.isa-geek.net>
>
> ---
>   dlls/shlwapi/thread.c |    4 ++--
>   1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/dlls/shlwapi/thread.c b/dlls/shlwapi/thread.c
> index eb2c35d..43e0433 100644
> --- a/dlls/shlwapi/thread.c
> +++ b/dlls/shlwapi/thread.c
> @@ -157,7 +157,7 @@ static ULONG WINAPI threadref_AddRef(IUnknown *iface)
>     threadref * This = impl_from_IUnknown(iface);
>   
>     TRACE("(%p)\n", This);
> -  return InterlockedIncrement(This->ref);
> +  return InterlockedIncrement(&This->ref);
>   }
>   
>   static ULONG WINAPI threadref_Release(IUnknown *iface)
> @@ -167,7 +167,7 @@ static ULONG WINAPI threadref_Release(IUnknown *iface)
>   
>     TRACE("(%p)\n", This);
>   
> -  refcount = InterlockedDecrement(This->ref);
> +  refcount = InterlockedDecrement(&This->ref);
>     if (!refcount)
>         HeapFree(GetProcessHeap(), 0, This);
>   
Did you try to build this?



More information about the wine-devel mailing list