On Mon, Apr 28, 2014 at 4:42 PM, Uri Lublin <uril@xxxxxxxxxx> wrote:
Generally, no crashes does not mean ref/unref are not needed.On 04/28/2014 03:49 PM, Marc-André Lureau wrote:
----- Original Message -----
On 04/23/2014 09:09 PM, Marc-André Lureau wrote:It wasn't needed until now (or we would have had crashes before), why would it be now?
A code doing an unref() on an object just before manipulating it looksSuspicious indeed.
horribly suspicious...
But probably it's better to move the unref below instead of removing the
ref/unref (see below).
A device is ref'ed when install/uninstall starts and is unref'ed when
install/uninstall finishes.
Possibly during install the ref is not needed (as there is another ref
for the redir operation),
but I think it is needed during uninstall.
When I read this code:
@@ -1122,7 +1120,6 @@ static void spice_usb_device_manager_drv_
uninstall_cb(GObject *gobject,
g_clear_error(&err);
}
- spice_usb_device_unref(cbinfo->device);
spice_usb_device_set_state(cbinfo->device, SPICE_USB_DEVICE_STATE_NONE);
g_clear_error(&err);
}
- spice_usb_device_unref(cbinfo->device);
spice_usb_device_set_state(cbinfo->device, SPICE_USB_DEVICE_STATE_NONE);
It seems pretty clear that this cbinfo ref wasn't involved to keep the device alive (same fo the install case).
--
Marc-André Lureau
_______________________________________________ Spice-devel mailing list Spice-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/spice-devel