GNOME Bugzilla – Bug 746866
[PATCH] wacom: don't unref GdkDevices when we don't own a reference
Last modified: 2015-04-15 08:50:15 UTC
Created attachment 300419 [details] [review] [PATCH] wacom: don't unref GdkDevices when we don't own a reference Commit 9e17dced137ff2fd05ed97c82e90a7725e9f82d7 added a bunch of unrefs which always unref the gdk_device after a g_object_get ("gdk-device"). That is wrong -- getting a property doesn't increase a refcount. This causes the GdkDevices to be freed too early causing all sorts of crashes due to use-after-free() conditions: https://bugzilla.redhat.com/show_bug.cgi?id=1194037 --- plugins/wacom/gsd-wacom-manager.c | 4 ---- plugins/wacom/list-wacom.c | 1 - 2 files changed, 5 deletions(-)
Review of attachment 300419 [details] [review]: Looks good. Please make sure to cherry-pick.
Comment on attachment 300419 [details] [review] [PATCH] wacom: don't unref GdkDevices when we don't own a reference The patch was pushed as is. I pushed 7b38b7fde on top replacing all g_object_get() calls with a getter.
FWIW, the patch is not needed on gnome-3-14
is there any reason the gdk-device property is GParamSpecPointer instead of GParamSpecObject ?
(In reply to Ray Strode [halfline] from comment #4) > is there any reason the gdk-device property is GParamSpecPointer instead of > GParamSpecObject ? Because it's easier to avoid cyclic references.