mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
winsys/amdgpu: Destroy dev_hash table when the last winsys is removed.
Fixes memory leak on module unload. CC: <mesa-stable@lists.freedesktop.org> Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu> Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
parent
a2e9d9b4c1
commit
58272c1ad7
1 changed files with 6 additions and 1 deletions
|
|
@ -220,8 +220,13 @@ static bool amdgpu_winsys_unref(struct radeon_winsys *rws)
|
|||
simple_mtx_lock(&dev_tab_mutex);
|
||||
|
||||
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) {
|
||||
util_hash_table_destroy(dev_tab);
|
||||
dev_tab = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
simple_mtx_unlock(&dev_tab_mutex);
|
||||
return destroy;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue