From 6ff7f43fcf02f2198de15e6d16c39dde54c97ac1 Mon Sep 17 00:00:00 2001 From: Niels De Graef Date: Tue, 31 Jan 2023 09:44:59 +0100 Subject: [PATCH] backends: Don't leak GSettingsSchema `g_settings_schema_source_lookup()` is marked with `(transfer full)` so make sure we actually free the struct at the end of the function. Part-of: --- src/backends/meta-orientation-manager.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backends/meta-orientation-manager.c b/src/backends/meta-orientation-manager.c index 82191e435..ba7a500a7 100644 --- a/src/backends/meta-orientation-manager.c +++ b/src/backends/meta-orientation-manager.c @@ -275,6 +275,7 @@ static void meta_orientation_manager_init (MetaOrientationManager *self) { GSettingsSchemaSource *schema_source = g_settings_schema_source_get_default (); + g_autoptr (GSettingsSchema) schema = NULL; self->iio_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM, "net.hadess.SensorProxy", @@ -284,7 +285,8 @@ meta_orientation_manager_init (MetaOrientationManager *self) self, NULL); - if (g_settings_schema_source_lookup (schema_source, CONF_SCHEMA, TRUE)) + schema = g_settings_schema_source_lookup (schema_source, CONF_SCHEMA, TRUE); + if (schema != NULL) { self->settings = g_settings_new (CONF_SCHEMA); g_signal_connect_object (self->settings, "changed::"ORIENTATION_LOCK_KEY,