diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index af3baab69..8f3bbdb53 100644 --- a/clutter/clutter/clutter-event.c +++ b/clutter/clutter/clutter-event.c @@ -1165,7 +1165,7 @@ clutter_event_set_device (ClutterEvent *event, case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_REMOVED: - g_set_object (&event->device.device, device); + event->device.device = device; break; } } @@ -1423,9 +1423,6 @@ clutter_event_copy (const ClutterEvent *event) case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_REMOVED: - g_set_object (&new_event->device.device, event->device.device); - break; - default: break; } @@ -1482,7 +1479,6 @@ clutter_event_free (ClutterEvent *event) break; case CLUTTER_DEVICE_ADDED: case CLUTTER_DEVICE_REMOVED: - g_clear_object (&event->device.device); break; default: diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c index 85db01d72..94c41cf93 100644 --- a/src/backends/native/meta-seat-impl.c +++ b/src/backends/native/meta-seat-impl.c @@ -1448,7 +1448,7 @@ evdev_add_device (MetaSeatImpl *seat, device = meta_input_device_native_new (seat, libinput_device); - seat->devices = g_slist_prepend (seat->devices, device); + seat->devices = g_slist_prepend (seat->devices, g_object_ref (device)); /* Clutter assumes that device types are exclusive in the * ClutterInputDevice API */ diff --git a/src/backends/native/meta-seat-native.c b/src/backends/native/meta-seat-native.c index d06de2b17..3fd268091 100644 --- a/src/backends/native/meta-seat-native.c +++ b/src/backends/native/meta-seat-native.c @@ -170,14 +170,6 @@ meta_seat_native_finalize (GObject *object) g_clear_object (&seat->core_keyboard); g_clear_object (&seat->impl); - for (iter = seat->devices; iter; iter = g_slist_next (iter)) - { - ClutterInputDevice *device = iter->data; - - g_object_unref (device); - } - g_slist_free (seat->devices); - g_clear_pointer (&seat->tablet_cursors, g_hash_table_unref); g_object_unref (seat->cursor_renderer);