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

Uri Lublin uril at redhat.com
Sun Jul 8 13:23:04 PDT 2012


On 07/06/2012 12:21 AM, Marc-André Lureau wrote:
> 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.
>

done.
The memset was there to catch memory problems (bugs). I dropped it.

Thanks,
     Uri.


More information about the Spice-devel mailing list