config: Combine two exit paths

This commit is contained in:
Jasper St. Pierre 2014-10-23 15:49:06 -07:00
parent 2c1a6b6a12
commit 4b2b431700

View File

@ -863,16 +863,13 @@ apply_configuration (MetaMonitorConfig *self,
MetaMonitorManager *manager) MetaMonitorManager *manager)
{ {
GPtrArray *crtcs, *outputs; GPtrArray *crtcs, *outputs;
gboolean ret = FALSE;
crtcs = g_ptr_array_new_full (config->n_outputs, (GDestroyNotify)meta_crtc_info_free); crtcs = g_ptr_array_new_full (config->n_outputs, (GDestroyNotify)meta_crtc_info_free);
outputs = g_ptr_array_new_full (config->n_outputs, (GDestroyNotify)meta_output_info_free); outputs = g_ptr_array_new_full (config->n_outputs, (GDestroyNotify)meta_output_info_free);
if (!meta_monitor_config_assign_crtcs (config, manager, crtcs, outputs)) if (!meta_monitor_config_assign_crtcs (config, manager, crtcs, outputs))
{ goto out;
g_ptr_array_unref (crtcs);
g_ptr_array_unref (outputs);
return FALSE;
}
meta_monitor_manager_apply_configuration (manager, meta_monitor_manager_apply_configuration (manager,
(MetaCRTCInfo**)crtcs->pdata, crtcs->len, (MetaCRTCInfo**)crtcs->pdata, crtcs->len,
@ -884,9 +881,12 @@ apply_configuration (MetaMonitorConfig *self,
* inside turn_off_laptop_display / apply_configuration_with_lid */ * inside turn_off_laptop_display / apply_configuration_with_lid */
self->current_is_for_laptop_lid = FALSE; self->current_is_for_laptop_lid = FALSE;
ret = TRUE;
out:
g_ptr_array_unref (crtcs); g_ptr_array_unref (crtcs);
g_ptr_array_unref (outputs); g_ptr_array_unref (outputs);
return TRUE; return ret;
} }
static gboolean static gboolean