[PATCH] msxml3: Refcount the domdoc/xmldoc properties.
Nikolay Sivov
nsivov at codeweavers.com
Sun May 2 03:59:50 CDT 2021
On 4/29/21 4:16 PM, Francois Gouget wrote:
> -static void free_properties(domdoc_properties* properties)
> +LONG properties_add_ref(domdoc_properties* properties)
> {
> - if (properties)
> + LONG ref = InterlockedExchangeAdd(&properties->refs, 1) + 1;
> + TRACE("(%p)->(%d)\n", properties, ref);
> + return ref;
> +}
> +
> +static LONG properties_release(domdoc_properties* properties)
> +{
> + LONG ref = InterlockedExchangeAdd(&properties->refs, -1) - 1;
> + TRACE("(%p)->(%d)\n", properties, ref);
> +
> + if (ref < 0)
> + WARN("negative refcount, expect troubles\n");
> +
Could we use InterlockedIncrement for that?
More information about the wine-devel
mailing list