[mutter] config: Fix a few memory leaks
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] config: Fix a few memory leaks
- Date: Wed, 22 Oct 2014 22:53:23 +0000 (UTC)
commit cd1e1d4bf181b1fca5df0cec0f31e48d9ccc3f56
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Wed Oct 22 15:50:27 2014 -0700
config: Fix a few memory leaks
We were forgetting to unref in a few places.
src/backends/meta-monitor-config.c | 11 ++++++-----
1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/backends/meta-monitor-config.c b/src/backends/meta-monitor-config.c
index 113a084..fe1f652 100644
--- a/src/backends/meta-monitor-config.c
+++ b/src/backends/meta-monitor-config.c
@@ -1251,7 +1251,7 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
MetaOutput *outputs;
MetaConfiguration *default_config;
unsigned n_outputs;
- gboolean ok;
+ gboolean ok = FALSE;
int max_width, max_height;
outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
@@ -1264,11 +1264,11 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
}
default_config = make_default_config (self, outputs, n_outputs, max_width, max_height);
-
if (default_config != NULL)
- ok = apply_configuration_with_lid (self, default_config, manager);
- else
- ok = FALSE;
+ {
+ ok = apply_configuration_with_lid (self, default_config, manager);
+ config_unref (default_config);
+ }
if (!ok)
{
@@ -1359,6 +1359,7 @@ turn_off_laptop_display (MetaMonitorConfig *self,
new = make_laptop_lid_config (self->current);
apply_configuration (self, new, manager);
+ config_unref (new);
self->current_is_for_laptop_lid = TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]