GNOME Bugzilla – Bug 712812
Crash and memory leak fixes for device removals
Last modified: 2013-11-22 10:22:28 UTC
Found a few problems on device removals. Please review.
Created attachment 260435 [details] [review] device-manager: Don't emit device-removed with a finalized instance
Created attachment 260436 [details] [review] input-device: Fix a GArray leak
Created attachment 260437 [details] [review] device-manager-xi2: Fix device instances leaking on removal Don't add an extra reference when adding to the devices hash table. We already own the initial reference.
Created attachment 260438 [details] [review] device-manager-evdev: Unref devices on removal
Created attachment 260439 [details] [review] device-manager-evdev: Fix a segfault on device removal The master devices have a NULL sysfs path so use g_strcmp0 to handle them without crashing.
Review of attachment 260435 [details] [review]: okay.
Review of attachment 260436 [details] [review]: okay, with a minor correction before pushing. ::: clutter/clutter-input-device.c @@ +108,3 @@ + if (device->scroll_info != NULL) + { + g_array_free (device->scroll_info, TRUE); I'd go for g_array_unref() here.
Review of attachment 260437 [details] [review]: okay.
Review of attachment 260438 [details] [review]: okay.
Review of attachment 260439 [details] [review]: okay, with one minor style correction before pushing. ::: clutter/evdev/clutter-device-manager-evdev.c @@ +945,3 @@ + if (g_strcmp0 (sysfs_path, + _clutter_input_device_evdev_get_sysfs_path (device)) == 0) please, put the arguments on the same line; 80 columns are a soft limit, and I intensely dislike multi-line single conditions for if().
Created attachment 260457 [details] [review] input-device: Fix a GArray leak
Created attachment 260458 [details] [review] input-device: Use g_clear_pointer -- To keep things consistent
Review of attachment 260458 [details] [review]: looks good.
Review of attachment 260457 [details] [review]: looks good.
Attachment 260435 [details] pushed as 1d11cc3 - device-manager: Don't emit device-removed with a finalized instance Attachment 260437 [details] pushed as ce1f8f1 - device-manager-xi2: Fix device instances leaking on removal Attachment 260438 [details] pushed as 7d8f72a - device-manager-evdev: Unref devices on removal Attachment 260439 [details] pushed as 05e6bcc - device-manager-evdev: Fix a segfault on device removal Attachment 260457 [details] pushed as 18b9384 - input-device: Fix a GArray leak Attachment 260458 [details] pushed as 507d8b1 - input-device: Use g_clear_pointer