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>
This commit is contained in:
Emma Anholt 2021-06-22 12:09:44 -07:00 committed by Marge Bot
parent b76f229954
commit 56c7e69c4d

View file

@ -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);