summaryrefslogtreecommitdiff
path: root/src/unittests
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2018-03-03 18:37:54 +0300
committerAndrei Karas <akaras@inbox.ru>2018-03-03 18:37:54 +0300
commitb889e7fe2d2b1162bad9cf39831e1becf3d9e480 (patch)
treeb733858909539a3b2a674c53544d83d2a74f0332 /src/unittests
parent77b2116504635c855c357dbabb9dd1e7f6620a75 (diff)
downloadmv-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.gz
mv-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.bz2
mv-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.xz
mv-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.zip
Fix memory leak in unit tests.
Diffstat (limited to 'src/unittests')
-rw-r--r--src/unittests/utils/itemxmlutils.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/unittests/utils/itemxmlutils.cc b/src/unittests/utils/itemxmlutils.cc
index 825bc2f97..84512b5be 100644
--- a/src/unittests/utils/itemxmlutils.cc
+++ b/src/unittests/utils/itemxmlutils.cc
@@ -35,6 +35,7 @@
#include "utils/delete2.h"
#include "utils/env.h"
+#include "utils/foreach.h"
#include "utils/xml.h"
#include "utils/itemxmlutils.h"
@@ -206,6 +207,10 @@ TEST_CASE("itemxmlutils readItemStatsString 1", "")
REQUIRE(effect == "Weight -2");
}
+ FOR_EACH(ItemFieldInfos::iterator, it, fields)
+ {
+ delete (*it).second;
+ }
delete2(userPalette);
delete2(theme);
delete2(client);
@@ -404,6 +409,10 @@ TEST_CASE("itemxmlutils readItemStatsVector 1", "")
REQUIRE(effect[0] == "Weight -2");
}
+ FOR_EACH(ItemFieldInfos::iterator, it, fields)
+ {
+ delete (*it).second;
+ }
delete2(userPalette);
delete2(theme);
delete2(client);