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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/06/2012 12:21 AM, Marc-André Lureau wrote:
On Thu, Jul 5, 2012 at 10:43 PM, Uri Lublin<uril@xxxxxxxxxx>  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.
_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]