app_server/BitmapManager: fix memory leak caused by missing token remove

`BTokenSpace::NewToken` put all allocated tokens into `fTokenMap` so
`BTokenSpace::RemoveToken` should be called for tokens that become unused to avoid infinite `fTokenMap` growth.

Change-Id: I0aee709234143ceaf4416d63b38fb2a26eb8f891
Reviewed-on: https://review.haiku-os.org/c/haiku/+/7417
Reviewed-by: Axel Dörfler <axeld@pinc-software.de>
Tested-by: Commit checker robot <no-reply+buildbot@haiku-os.org>
This commit is contained in:
X512 2024-02-18 19:34:50 +09:00 committed by Axel Dörfler
parent 0e268215f3
commit d72ca12e19
1 changed files with 2 additions and 0 deletions

View File

@ -228,6 +228,8 @@ BitmapManager::BitmapRemoved(ServerBitmap* bitmap)
if (!locker.IsLocked())
return;
gTokenSpace.RemoveToken(bitmap->Token());
if (bitmap->Overlay() != NULL)
fOverlays.RemoveItem(bitmap);