device-manager: Don't emit device-removed with a finalized instance

https://bugzilla.gnome.org/show_bug.cgi?id=712812
This commit is contained in:
Rui Matos 2013-11-21 14:46:04 +01:00
parent 45f30d221f
commit 1d11cc324e

View File

@ -368,9 +368,14 @@ _clutter_device_manager_remove_device (ClutterDeviceManager *device_manager,
manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager); manager_class = CLUTTER_DEVICE_MANAGER_GET_CLASS (device_manager);
g_assert (manager_class->remove_device != NULL); g_assert (manager_class->remove_device != NULL);
manager_class->remove_device (device_manager, device); /* The subclass remove_device() method will likely unref it but we
have to keep it alive during the signal emission. */
g_object_ref (device);
manager_class->remove_device (device_manager, device);
g_signal_emit (device_manager, manager_signals[DEVICE_REMOVED], 0, device); g_signal_emit (device_manager, manager_signals[DEVICE_REMOVED], 0, device);
g_object_unref (device);
} }
/* /*