1
0
Fork 0

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: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2817>
This commit is contained in:
Niels De Graef 2023-01-31 09:44:59 +01:00 committed by Marge Bot
parent 019267a044
commit 6ff7f43fcf

View file

@ -275,6 +275,7 @@ static void
meta_orientation_manager_init (MetaOrientationManager *self) meta_orientation_manager_init (MetaOrientationManager *self)
{ {
GSettingsSchemaSource *schema_source = g_settings_schema_source_get_default (); 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, self->iio_watch_id = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
"net.hadess.SensorProxy", "net.hadess.SensorProxy",
@ -284,7 +285,8 @@ meta_orientation_manager_init (MetaOrientationManager *self)
self, self,
NULL); 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); self->settings = g_settings_new (CONF_SCHEMA);
g_signal_connect_object (self->settings, "changed::"ORIENTATION_LOCK_KEY, g_signal_connect_object (self->settings, "changed::"ORIENTATION_LOCK_KEY,