[gtk/wip/nacho/associated-device] gdkdevice: use g_set_object to set the associated device
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/nacho/associated-device] gdkdevice: use g_set_object to set the associated device
- Date: Thu, 7 Jan 2021 15:14:31 +0000 (UTC)
commit 3ca3d7efeff9dcdad713e8f4f8179e662b8959d0
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Thu Jan 7 16:13:39 2021 +0100
gdkdevice: use g_set_object to set the associated device
gdk/gdkdevice.c | 12 +-----------
1 file changed, 1 insertion(+), 11 deletions(-)
---
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index 34506fcd37..f96dbc5e65 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -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);
}
/*
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]