<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 28, 2014 at 4:42 PM, Uri Lublin <span dir="ltr"><<a href="mailto:uril@redhat.com" target="_blank">uril@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class=""><div class="h5">On 04/28/2014 03:49 PM, Marc-André Lureau wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
----- Original Message -----<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
On 04/23/2014 09:09 PM, Marc-André Lureau wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
A code doing an unref() on an object just before manipulating it looks<br>
horribly suspicious...<br>
</blockquote>
Suspicious indeed.<br>
<br>
But probably it's better to move the unref below instead of removing the<br>
ref/unref (see below).<br>
<br>
A device is ref'ed when install/uninstall starts and is unref'ed when<br>
install/uninstall finishes.<br>
<br>
Possibly during install the ref is not needed (as there is another ref<br>
for the redir operation),<br>
but I think it is needed during uninstall.<br>
<br>
</blockquote>
It wasn't needed until now (or we would have had crashes before), why would it be now?<br>
</blockquote>
<br></div></div>
Generally, no crashes does not mean ref/unref are not needed.</blockquote></div><br><br>When I read this code:<br><br>@@ -1122,7 +1120,6 @@ static void spice_usb_device_manager_drv_<div id=":19g" class="">uninstall_cb(GObject *gobject,<br>
g_clear_error(&err);<br>
}<br>
<br>
- spice_usb_device_unref(cbinfo->device);<br>
spice_usb_device_set_state(cbinfo->device, SPICE_USB_DEVICE_STATE_NONE);</div><br></div><div class="gmail_extra">It seems pretty clear that this cbinfo ref wasn't involved to keep the device alive (same fo the install case).<br clear="all">
</div><div class="gmail_extra"><br>-- <br>Marc-André Lureau
</div></div>