From b7780e2dc68d801f3707addf07c00a80f7fdd901 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Wed, 28 Oct 2009 02:18:53 +0000 Subject: [PATCH] fix tiny memleaks from DF vectors --- library/DFHackAPI.cpp | 8 ++++++++ library/md5/md5.h | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/library/DFHackAPI.cpp b/library/DFHackAPI.cpp index 2e8056c21..03e551cff 100644 --- a/library/DFHackAPI.cpp +++ b/library/DFHackAPI.cpp @@ -545,6 +545,8 @@ bool DFHackAPIImpl::ReadBuilding(const uint32_t &index, t_building & building) void DFHackAPIImpl::FinishReadBuildings() { + delete p_bld; + p_bld = NULL; buildingsInited = false; } @@ -586,6 +588,8 @@ bool DFHackAPIImpl::ReadConstruction(const uint32_t &index, t_construction & con void DFHackAPIImpl::FinishReadConstructions() { + delete p_cons; + p_cons = NULL; constructionsInited = false; } @@ -617,6 +621,8 @@ bool DFHackAPIImpl::ReadVegetation(const uint32_t &index, t_tree_desc & shrubber void DFHackAPIImpl::FinishReadVegetation() { + delete p_veg; + p_veg = NULL; vegetationInited = false; } @@ -652,6 +658,8 @@ bool DFHackAPIImpl::ReadCreature(const uint32_t &index, t_creature & furball) void DFHackAPIImpl::FinishReadCreatures() { + delete p_cre; + p_cre = NULL; creaturesInited = false; } diff --git a/library/md5/md5.h b/library/md5/md5.h index b01e0ff34..d1cedc9d2 100644 --- a/library/md5/md5.h +++ b/library/md5/md5.h @@ -45,7 +45,7 @@ //---------------------------------------------------------------------- //STL includes #include -#include "integers.h" +#include "../integers.h" //---------------------------------------------------------------------- //typedefs typedef unsigned char *POINTER;