[mutter/wip/carlosg/input-thread: 83/86] backends/native: Add missing seat finalization paths
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/carlosg/input-thread: 83/86] backends/native: Add missing seat finalization paths
- Date: Sun, 22 Nov 2020 17:34:05 +0000 (UTC)
commit af21410c1912889ea2ac8c75837e5839c19c94df
Author: Carlos Garnacho <carlosg gnome org>
Date: Sat Nov 21 14:05:08 2020 +0100
backends/native: Add missing seat finalization paths
On finalize we leak the clutter backend, which leaks the stage and seat.
src/backends/meta-backend.c | 2 ++
src/backends/native/meta-clutter-backend-native.c | 14 ++++++++++++++
2 files changed, 16 insertions(+)
---
diff --git a/src/backends/meta-backend.c b/src/backends/meta-backend.c
index b823f2080d..b445bbcbf6 100644
--- a/src/backends/meta-backend.c
+++ b/src/backends/meta-backend.c
@@ -243,6 +243,8 @@ meta_backend_finalize (GObject *object)
g_clear_object (&priv->profiler);
#endif
+ g_clear_object (&priv->clutter_backend);
+
G_OBJECT_CLASS (meta_backend_parent_class)->finalize (object);
}
diff --git a/src/backends/native/meta-clutter-backend-native.c
b/src/backends/native/meta-clutter-backend-native.c
index 58d6afa44f..a1d0d09716 100644
--- a/src/backends/native/meta-clutter-backend-native.c
+++ b/src/backends/native/meta-clutter-backend-native.c
@@ -125,6 +125,17 @@ meta_clutter_backend_native_is_display_server (ClutterBackend *backend)
return TRUE;
}
+static void
+meta_clutter_backend_native_finalize (GObject *object)
+{
+ MetaClutterBackendNative *backend_native = META_CLUTTER_BACKEND_NATIVE (object);
+
+ g_clear_object (&backend_native->main_seat);
+ g_clear_object (&backend_native->stage_native);
+
+ G_OBJECT_CLASS (meta_clutter_backend_native_parent_class)->finalize (object);
+}
+
static void
meta_clutter_backend_native_init (MetaClutterBackendNative *clutter_backend_nativen)
{
@@ -133,8 +144,11 @@ meta_clutter_backend_native_init (MetaClutterBackendNative *clutter_backend_nati
static void
meta_clutter_backend_native_class_init (MetaClutterBackendNativeClass *klass)
{
+ GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterBackendClass *clutter_backend_class = CLUTTER_BACKEND_CLASS (klass);
+ object_class->finalize = meta_clutter_backend_native_finalize;
+
clutter_backend_class->get_renderer = meta_clutter_backend_native_get_renderer;
clutter_backend_class->create_stage = meta_clutter_backend_native_create_stage;
clutter_backend_class->init_events = meta_clutter_backend_native_init_events;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]