mirror of
https://github.com/brl/mutter.git
synced 2025-02-18 06:04:10 +00:00
config: Fix a few memory leaks
We were forgetting to unref in a few places.
This commit is contained in:
parent
9710c013c5
commit
cd1e1d4bf1
@ -1251,7 +1251,7 @@ meta_monitor_config_make_default (MetaMonitorConfig *self,
|
|||||||
MetaOutput *outputs;
|
MetaOutput *outputs;
|
||||||
MetaConfiguration *default_config;
|
MetaConfiguration *default_config;
|
||||||
unsigned n_outputs;
|
unsigned n_outputs;
|
||||||
gboolean ok;
|
gboolean ok = FALSE;
|
||||||
int max_width, max_height;
|
int max_width, max_height;
|
||||||
|
|
||||||
outputs = meta_monitor_manager_get_outputs (manager, &n_outputs);
|
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);
|
default_config = make_default_config (self, outputs, n_outputs, max_width, max_height);
|
||||||
|
|
||||||
if (default_config != NULL)
|
if (default_config != NULL)
|
||||||
ok = apply_configuration_with_lid (self, default_config, manager);
|
{
|
||||||
else
|
ok = apply_configuration_with_lid (self, default_config, manager);
|
||||||
ok = FALSE;
|
config_unref (default_config);
|
||||||
|
}
|
||||||
|
|
||||||
if (!ok)
|
if (!ok)
|
||||||
{
|
{
|
||||||
@ -1359,6 +1359,7 @@ turn_off_laptop_display (MetaMonitorConfig *self,
|
|||||||
|
|
||||||
new = make_laptop_lid_config (self->current);
|
new = make_laptop_lid_config (self->current);
|
||||||
apply_configuration (self, new, manager);
|
apply_configuration (self, new, manager);
|
||||||
|
config_unref (new);
|
||||||
self->current_is_for_laptop_lid = TRUE;
|
self->current_is_for_laptop_lid = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user