[Spice-devel] [spice-gtk Win32 v4 02/17] Introduce SpiceUsbDeviceInfo to be kept instead of a libusb_device

Marc-André Lureau marcandre.lureau at gmail.com
Thu Jul 5 14:21:50 PDT 2012


On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin <uril at redhat.com> wrote:
> +    ref = atomic_dec(&info->ref);
> +    if (ref == 0) {
> +        memset(info, 0, sizeof(*info));
> +        g_free(info);
> +    }

we should really be using the g_atomic operations.
g_atomic_int_dec_and_test () is idiomatic for unref (it may be more
correct). the memset isn't really helping here.

-- 
Marc-André Lureau


More information about the Spice-devel mailing list