1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Fix remaining memory leaks caused by API misuse

This commit is contained in:
Ivan Savenko
2025-04-28 13:55:57 +03:00
parent c0fb1d1b3b
commit 554a414302
6 changed files with 17 additions and 8 deletions

View File

@@ -236,8 +236,8 @@ SDLImageScaler::~SDLImageScaler()
{
ENGINE->dispatchMainThread([surface = intermediate]()
{
// potentially SDL bug, execute SDL_FreeSurface in main thread to avoid thread races to its internal state
// may be fixed somewhere between 2.26.5 - 2.30
// SDL_FreeSurface must be executed in main thread to avoid thread races to its internal state
// will be no longer necessary in SDL 3
SDL_FreeSurface(surface);
});
}