mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-15 01:24:45 +02:00
Fix issues found by Valgrind
This commit is contained in:
@ -24,7 +24,6 @@
|
||||
#include "../../lib/CConfigHandler.h"
|
||||
|
||||
#include <tbb/parallel_for.h>
|
||||
#include <tbb/task_arena.h>
|
||||
|
||||
#include <SDL_image.h>
|
||||
#include <SDL_surface.h>
|
||||
@ -400,6 +399,9 @@ std::shared_ptr<const ISharedImage> SDLImageShared::horizontalFlip() const
|
||||
ret->margins.y = fullSize.y - surf->h - margins.y;
|
||||
ret->fullSize = fullSize;
|
||||
|
||||
// erase our own reference
|
||||
SDL_FreeSurface(flipped);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@ -418,6 +420,9 @@ std::shared_ptr<const ISharedImage> SDLImageShared::verticalFlip() const
|
||||
ret->margins.y = margins.y;
|
||||
ret->fullSize = fullSize;
|
||||
|
||||
// erase our own reference
|
||||
SDL_FreeSurface(flipped);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user