mirror of
				https://github.com/vcmi/vcmi.git
				synced 2025-10-31 00:07:39 +02:00 
			
		
		
		
	Fixes for issues detected by valgrind
This commit is contained in:
		| @@ -25,6 +25,11 @@ CanvasImage::CanvasImage(const Point & size, CanvasScalingPolicy scalingPolicy) | ||||
| { | ||||
| } | ||||
|  | ||||
| CanvasImage::~CanvasImage() | ||||
| { | ||||
| 	SDL_FreeSurface(surface); | ||||
| } | ||||
|  | ||||
| void CanvasImage::draw(SDL_Surface * where, const Point & pos, const Rect * src, int scalingFactor) const | ||||
| { | ||||
| 	if(src) | ||||
|   | ||||
| @@ -16,6 +16,7 @@ class CanvasImage : public IImage | ||||
| { | ||||
| public: | ||||
| 	CanvasImage(const Point & size, CanvasScalingPolicy scalingPolicy); | ||||
| 	~CanvasImage(); | ||||
|  | ||||
| 	Canvas getCanvas(); | ||||
|  | ||||
|   | ||||
| @@ -188,6 +188,7 @@ std::shared_ptr<Bonus> CBonusSystemNode::getUpdatedBonus(const std::shared_ptr<B | ||||
| CBonusSystemNode::CBonusSystemNode(bool isHypotetic): | ||||
| 	nodeType(UNKNOWN), | ||||
| 	cachedLast(0), | ||||
| 	nodeChanged(0), | ||||
| 	isHypotheticNode(isHypotetic) | ||||
| { | ||||
| } | ||||
| @@ -195,6 +196,7 @@ CBonusSystemNode::CBonusSystemNode(bool isHypotetic): | ||||
| CBonusSystemNode::CBonusSystemNode(ENodeTypes NodeType): | ||||
| 	nodeType(NodeType), | ||||
| 	cachedLast(0), | ||||
| 	nodeChanged(0), | ||||
| 	isHypotheticNode(false) | ||||
| { | ||||
| } | ||||
|   | ||||
| @@ -117,8 +117,17 @@ void CMapHeader::setupEvents() | ||||
| 	defeatMessage.appendTextID("core.lcdesc.0"); | ||||
| } | ||||
|  | ||||
| CMapHeader::CMapHeader() : version(EMapFormat::VCMI), height(72), width(72), | ||||
| 	twoLevel(true), difficulty(EMapDifficulty::NORMAL), levelLimit(0), howManyTeams(0), areAnyPlayers(false) | ||||
| CMapHeader::CMapHeader() | ||||
| 	: version(EMapFormat::VCMI) | ||||
| 	, height(72) | ||||
| 	, width(72) | ||||
| 	, twoLevel(true) | ||||
| 	, difficulty(EMapDifficulty::NORMAL) | ||||
| 	, levelLimit(0) | ||||
| 	, howManyTeams(0) | ||||
| 	, areAnyPlayers(false) | ||||
| 	, victoryIconIndex(0) | ||||
| 	, defeatIconIndex(0) | ||||
| { | ||||
| 	setupEvents(); | ||||
| 	allowedHeroes = VLC->heroh->getDefaultAllowed(); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user