backends: Plug leaks
The DRM properties container must be destroyed with drmModeFreeObjectProperties, and the connectors must be freed on every caller. Also make it sure that gbm_device structs are destroyed with the MetaRendererNativeGpuData that owns them. https://bugzilla.gnome.org/show_bug.cgi?id=789984
This commit is contained in:
parent
0a36a4545f
commit
eb236649fc
@ -304,6 +304,8 @@ find_crtc_properties (MetaCrtc *crtc,
|
||||
|
||||
drmModeFreeProperty (prop);
|
||||
}
|
||||
|
||||
drmModeFreeObjectProperties (props);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -141,6 +141,7 @@ meta_gpu_kms_apply_crtc_mode (MetaGpuKms *gpu_kms,
|
||||
mode) != 0)
|
||||
{
|
||||
g_warning ("Failed to set CRTC mode %s: %m", crtc->current_mode->name);
|
||||
g_free (connectors);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -224,6 +225,7 @@ meta_gpu_kms_flip_crtc (MetaGpuKms *gpu_kms,
|
||||
|
||||
get_crtc_drm_connectors (gpu, crtc, &connectors, &n_connectors);
|
||||
g_assert (n_connectors > 0);
|
||||
g_free (connectors);
|
||||
|
||||
if (!gpu_kms->page_flips_not_supported)
|
||||
{
|
||||
|
@ -243,6 +243,7 @@ meta_renderer_native_gpu_data_free (MetaRendererNativeGpuData *renderer_gpu_data
|
||||
if (renderer_gpu_data->egl_display != EGL_NO_DISPLAY)
|
||||
meta_egl_terminate (egl, renderer_gpu_data->egl_display, NULL);
|
||||
|
||||
g_clear_pointer (&renderer_gpu_data->gbm.device, gbm_device_destroy);
|
||||
g_free (renderer_gpu_data);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user