[mutter] backends: Plug leaks
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] backends: Plug leaks
- Date: Tue, 7 Nov 2017 10:13:40 +0000 (UTC)
commit eb236649fc843dfd07ba18412f1be7b033923df3
Author: Carlos Garnacho <carlosg gnome org>
Date: Mon Nov 6 20:39:56 2017 +0100
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
src/backends/native/meta-crtc-kms.c | 2 ++
src/backends/native/meta-gpu-kms.c | 2 ++
src/backends/native/meta-renderer-native.c | 1 +
3 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/backends/native/meta-crtc-kms.c b/src/backends/native/meta-crtc-kms.c
index 29b8280..492734e 100644
--- a/src/backends/native/meta-crtc-kms.c
+++ b/src/backends/native/meta-crtc-kms.c
@@ -304,6 +304,8 @@ find_crtc_properties (MetaCrtc *crtc,
drmModeFreeProperty (prop);
}
+
+ drmModeFreeObjectProperties (props);
}
static void
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index 38c2e9b..2d17af7 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -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)
{
diff --git a/src/backends/native/meta-renderer-native.c b/src/backends/native/meta-renderer-native.c
index 6137908..f6c3589 100644
--- a/src/backends/native/meta-renderer-native.c
+++ b/src/backends/native/meta-renderer-native.c
@@ -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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]