Rémi Bernon (@rbernon) commented about dlls/windows.devices.geolocation.geolocator/main.c:
+static ULONG WINAPI weak_reference_AddRef(IWeakReference *iface) +{
- struct geolocator *impl = impl_from_IWeakReference(iface);
- ULONG ref = InterlockedIncrement(&impl->ref_weak);
- TRACE("iface %p increasing refcount to %lu.\n", iface, ref);
- return ref;
+}
+static ULONG WINAPI weak_reference_Release(IWeakReference *iface) +{
- struct geolocator *impl = impl_from_IWeakReference(iface);
- ULONG ref = InterlockedDecrement(&impl->ref_weak);
- if (ref == 0)
- {
free(impl);
- }
```suggestion:-3+0 if (!ref) free(impl); ```
I think we usually prefer this rather than comparing to 0.