mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 17:40:40 -05:00
MetaMonitorManageKms: plug a GArray leak
https://bugzilla.gnome.org/show_bug.cgi?id=773116
This commit is contained in:
parent
1cb9cfe11d
commit
89672fad04
@ -1531,31 +1531,19 @@ get_crtc_connectors (MetaMonitorManager *manager,
|
||||
uint32_t **connectors,
|
||||
unsigned int *n_connectors)
|
||||
{
|
||||
GArray *connectors_array = NULL;
|
||||
unsigned int i;
|
||||
GArray *connectors_array = g_array_new (FALSE, FALSE, sizeof (uint32_t));
|
||||
|
||||
for (i = 0; i < manager->n_outputs; i++)
|
||||
{
|
||||
MetaOutput *output = &manager->outputs[i];
|
||||
|
||||
if (output->crtc == crtc)
|
||||
{
|
||||
if (!connectors_array)
|
||||
connectors_array = g_array_new (FALSE, FALSE, sizeof (uint32_t));
|
||||
g_array_append_val (connectors_array, output->winsys_id);
|
||||
}
|
||||
}
|
||||
|
||||
if (connectors_array)
|
||||
{
|
||||
*connectors = (uint32_t *) connectors_array->data;
|
||||
*n_connectors = connectors_array->len;
|
||||
}
|
||||
else
|
||||
{
|
||||
*connectors = NULL;
|
||||
*n_connectors = 0;
|
||||
}
|
||||
*connectors = (uint32_t *) g_array_free (connectors_array, FALSE);
|
||||
}
|
||||
|
||||
void
|
||||
|
Loading…
Reference in New Issue
Block a user