<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 1 Mar 2016, at 22:17 PM, Jonathon Jongsma <<a href="mailto:jjongsma@redhat.com" class="">jjongsma@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">On Sun, 2016-02-28 at 11:54 +0200, Dmitry Fleytman wrote:</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">From: Kirill Moizik <<a href="mailto:kmoizik@redhat.com" class="">kmoizik@redhat.com</a>><br class=""><br class="">Signed-off-by: Kirill Moizik <<a href="mailto:kmoizik@redhat.com" class="">kmoizik@redhat.com</a>><br class="">Signed-off-by: Dmitry Fleytman <<a href="mailto:dfleytma@redhat.com" class="">dfleytma@redhat.com</a>><br class="">---<br class="">src/usb-device-widget.c | 33 ++++++++++++++++++++++++---------<br class="">1 file changed, 24 insertions(+), 9 deletions(-)<br class=""><br class="">diff --git a/src/usb-device-widget.c b/src/usb-device-widget.c<br class="">index 56bdeaf..3166225 100644<br class="">--- a/src/usb-device-widget.c<br class="">+++ b/src/usb-device-widget.c<br class="">@@ -436,6 +436,20 @@ typedef struct _connect_cb_data {<br class="">    SpiceUsbDeviceWidget *self;<br class="">} connect_cb_data;<br class=""><br class="">+static void connect_cb_data_free(connect_cb_data *data)<br class="">+{<br class="">+    spice_usb_device_widget_update_status(data->self);<br class="">+    g_object_unref(data->check);<br class="">+    g_object_unref(data->self);<br class="">+    g_free(data);<br class="">+}<br class="">+<br class="">+static void _disconnect_cb(GObject *gobject, GAsyncResult *res, gpointer<br class="">user_data)<br class="">+{<br class="">+    connect_cb_data *data = user_data;<br class="">+    connect_cb_data_free(data);<br class="">+}<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">As mentioned in an earlier patch, there really should be a</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">_disconnect_device_finish() function to call here. Otherwise the patch looks</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">good.</span><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""></div></blockquote><div><br class=""></div><div>Done, thanks.</div><br class=""><blockquote type="cite" class=""><div class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><blockquote type="cite" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">+<br class="">static void connect_cb(GObject *gobject, GAsyncResult *res, gpointer<br class="">user_data)<br class="">{<br class="">    SpiceUsbDeviceManager *manager = SPICE_USB_DEVICE_MANAGER(gobject);<br class="">@@ -461,10 +475,7 @@ static void connect_cb(GObject *gobject, GAsyncResult<br class="">*res, gpointer user_data)<br class="">        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(data->check), FALSE);<br class="">    }<br class=""><br class="">-    spice_usb_device_widget_update_status(self);<br class="">-    g_object_unref(data->check);<br class="">-    g_object_unref(data->self);<br class="">-    g_free(data);<br class="">+    connect_cb_data_free(data);<br class="">}<br class=""><br class="">static void checkbox_clicked_cb(GtkWidget *check, gpointer user_data)<br class="">@@ -474,19 +485,23 @@ static void checkbox_clicked_cb(GtkWidget *check,<br class="">gpointer user_data)<br class="">    SpiceUsbDevice *device;<br class=""><br class="">    device = g_object_get_data(G_OBJECT(check), "usb-device");<br class="">+    connect_cb_data *data = g_new(connect_cb_data, 1);<br class="">+    data->check = g_object_ref(check);<br class="">+    data->self  = g_object_ref(self);<br class=""><br class="">    if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(check))) {<br class="">-        connect_cb_data *data = g_new(connect_cb_data, 1);<br class="">-        data->check = g_object_ref(check);<br class="">-        data->self  = g_object_ref(self);<br class="">        spice_usb_device_manager_connect_device_async(priv->manager,<br class="">                                                      device,<br class="">                                                      NULL,<br class="">                                                      connect_cb,<br class="">                                                      data);<br class="">    } else {<br class="">-        spice_usb_device_manager_disconnect_device(priv->manager,<br class="">-                                                   device);<br class="">+        spice_usb_device_manager_disconnect_device_async(priv->manager,<br class="">+                                                         device,<br class="">+                                                         NULL,<br class="">+                                                         _disconnect_cb,<br class="">+                                                         data);<br class="">+<br class="">    }<br class="">    spice_usb_device_widget_update_status(self);<br class="">}<br class=""></blockquote><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><br style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class=""><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">Reviewed-by: Jonathon Jongsma <</span><a href="mailto:jjongsma@redhat.com" style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;" class="">jjongsma@redhat.com</a><span style="font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;" class="">></span></div></blockquote></div><br class=""></body></html>