config: Fix a few memory leaks

We were forgetting to unref in a few places.
This commit is contained in:
Jasper St. Pierre 2014-10-22 15:50:27 -07:00
parent 9710c013c5
commit cd1e1d4bf1

View File

@ -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;
}