gdkdevice: use g_set_object to set the associated device

This commit is contained in:
Ignacio Casal Quinteiro 2021-01-07 16:13:39 +01:00
parent d8d8322912
commit 3ca3d7efef

View File

@ -611,17 +611,7 @@ _gdk_device_set_associated_device (GdkDevice *device,
g_return_if_fail (GDK_IS_DEVICE (device));
g_return_if_fail (associated == NULL || GDK_IS_DEVICE (associated));
if (device->associated == associated)
return;
if (device->associated)
{
g_object_unref (device->associated);
device->associated = NULL;
}
if (associated)
device->associated = g_object_ref (associated);
g_set_object (&device->associated, associated);
}
/*