[mutter] backends/native: Protect against NULL pointer constraints
- From: Marge Bot <marge-bot src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends/native: Protect against NULL pointer constraints
- Date: Tue, 22 Dec 2020 14:11:26 +0000 (UTC)
commit 904d7fa79899066865c6c9bf1a73762b6158ada8
Author: Olivier Fourdan <ofourdan redhat com>
Date: Mon Dec 21 13:25:28 2020 +0100
backends/native: Protect against NULL pointer constraints
To clear a pointer constraint, the Wayland backend passes a NULL
constraint to the native input backend.
The new async API however tries to reference/un-reference the given
object to use it while running in a separate task, which leads to a
warning from GLib trying to g_object_ref()/g_object_unref() a non
GObject pointer.
To avoid that issue, simply set the data only if the given constraints
pointer is not NULL.
Suggested-by: Carlos Garnacho <carlosg gnome org>
Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1587
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1652>
src/backends/native/meta-seat-impl.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/backends/native/meta-seat-impl.c b/src/backends/native/meta-seat-impl.c
index 904a9079f6..a9c0053b84 100644
--- a/src/backends/native/meta-seat-impl.c
+++ b/src/backends/native/meta-seat-impl.c
@@ -3333,7 +3333,8 @@ meta_seat_impl_set_pointer_constraint (MetaSeatImpl *seat,
g_return_if_fail (META_IS_SEAT_IMPL (seat));
task = g_task_new (seat, NULL, NULL, NULL);
- g_task_set_task_data (task, g_object_ref (constraint_impl), g_object_unref);
+ if (constraint_impl)
+ g_task_set_task_data (task, g_object_ref (constraint_impl), g_object_unref);
meta_seat_impl_run_input_task (seat, task,
(GSourceFunc) set_pointer_constraint);
g_object_unref (task);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]