summaryrefslogtreecommitdiff
path: root/src/gallium/winsys
diff options
context:
space:
mode:
authorEmma Anholt <emma@anholt.net>2021-06-22 12:09:44 -0700
committerMarge Bot <eric+marge@anholt.net>2021-06-22 20:39:18 +0000
commit56c7e69c4d9dca0e4e0f4c56dcfe97e8b8b4aa5e (patch)
treefe1a6972ebb292a0edc761cb8a071cd6492ed214 /src/gallium/winsys
parentb76f2299544c73c831edf4b1e212427a41ccdd23 (diff)
freedreno: Fix leak of the screen hash table.
Now we have no leaks detected on a run of a basic deqp test (dEQP-GLES2.functional.shaders.constants.const_float_assignment_3_fragment). Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11537>
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c b/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
index 6773af41b18..211e1656429 100644
--- a/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
+++ b/src/gallium/winsys/freedreno/drm/freedreno_drm_winsys.c
@@ -54,6 +54,11 @@ fd_drm_screen_destroy(struct pipe_screen *pscreen)
if (destroy) {
int fd = fd_device_fd(screen->dev);
_mesa_hash_table_remove_key(fd_tab, intptr_to_pointer(fd));
+
+ if (!fd_tab->entries) {
+ _mesa_hash_table_destroy(fd_tab, NULL);
+ fd_tab = NULL;
+ }
}
mtx_unlock(&fd_screen_mutex);