[spice-gtk,4/7] usb-device-manager: Move devices and channels to USE_USBREDIR section

Submitted by Frediano Ziglio on July 11, 2019, 1 p.m.

Details

Message ID 20190711130054.17867-4-fziglio@redhat.com
State Accepted
Commit 1655acd0d3dae8ca1489f54503bb13293ef287c1
Headers show
Series "Series without cover letter" ( rev: 1 ) in Spice

Not browsing as part of any series.

Commit Message

Frediano Ziglio July 11, 2019, 1 p.m.
These fields are not used if USE_USBREDIR is not set.

Signed-off-by: Frediano Ziglio <fziglio@redhat.com>
---
 src/usb-device-manager.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Patch hide | download patch | download mbox

diff --git a/src/usb-device-manager.c b/src/usb-device-manager.c
index 4b126896..dbb78390 100644
--- a/src/usb-device-manager.c
+++ b/src/usb-device-manager.c
@@ -107,10 +107,10 @@  struct _SpiceUsbDeviceManagerPrivate {
     HANDLE usbdk_hider_handle;
 #else
     gboolean redirecting; /* Handled by GUdevClient in the gudev case */
-#endif
 #endif
     GPtrArray *devices;
     GPtrArray *channels;
+#endif
 };
 
 enum {
@@ -246,8 +246,8 @@  static void spice_usb_device_manager_init(SpiceUsbDeviceManager *self)
         spice_debug("UsbDk driver is not installed");
     }
 #endif
-    priv->channels = g_ptr_array_new();
 #ifdef USE_USBREDIR
+    priv->channels = g_ptr_array_new();
     priv->devices  = g_ptr_array_new_with_free_func((GDestroyNotify)
                                                     spice_usb_device_unref);
 #endif
@@ -343,11 +343,11 @@  static void spice_usb_device_manager_finalize(GObject *gobject)
     SpiceUsbDeviceManager *self = SPICE_USB_DEVICE_MANAGER(gobject);
     SpiceUsbDeviceManagerPrivate *priv = self->priv;
 
+#ifdef USE_USBREDIR
     g_ptr_array_unref(priv->channels);
-    if (priv->devices)
+    if (priv->devices) {
         g_ptr_array_unref(priv->devices);
-
-#ifdef USE_USBREDIR
+    }
 #ifdef G_OS_WIN32
     g_clear_object(&priv->udev);
 #endif