Commit 36c24a60 authored by Jan Vesely's avatar Jan Vesely Committed by Dylan Baker

winsys/amdgpu: Destroy dev_hash table when the last winsys is removed.

Fixes memory leak on module unload.

CC: <>
Signed-off-by: Jan Vesely's avatarJan Vesely <>
Reviewed-by: 's avatarMarek Olšák <>
(cherry picked from commit 58272c1a)
parent 1def4eaa
......@@ -220,8 +220,13 @@ static bool amdgpu_winsys_unref(struct radeon_winsys *rws)
destroy = pipe_reference(&ws->reference, NULL);
if (destroy && dev_tab)
if (destroy && dev_tab) {
util_hash_table_remove(dev_tab, ws->dev);
if (util_hash_table_count(dev_tab) == 0) {
dev_tab = NULL;
return destroy;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment