mirror of
https://github.com/vcmi/vcmi.git
synced 2025-07-17 01:32:21 +02:00
Fix issues found by Valgrind
This commit is contained in:
@ -64,6 +64,12 @@ CSoundHandler::~CSoundHandler()
|
||||
if(chunk.second.first)
|
||||
Mix_FreeChunk(chunk.second.first);
|
||||
}
|
||||
|
||||
for(auto & chunk : soundChunksRaw)
|
||||
{
|
||||
if(chunk.second.first)
|
||||
Mix_FreeChunk(chunk.second.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ public:
|
||||
COMPLIANT = 0, FRIENDLY = 1, AGGRESSIVE = 2, HOSTILE = 3, SAVAGE = 4
|
||||
};
|
||||
|
||||
ui32 identifier; //unique code for this monster (used in missions)
|
||||
ui32 identifier = -1; //unique code for this monster (used in missions)
|
||||
si8 character = 0; //character of this set of creatures (0 - the most friendly, 4 - the most hostile) => on init changed to -4 (compliant) ... 10 value (savage)
|
||||
MetaString message; //message printed for attacking hero
|
||||
TResources resources; // resources given to hero that has won with monsters
|
||||
|
Reference in New Issue
Block a user