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?