diff options
author | Andrei Karas <akaras@inbox.ru> | 2018-03-03 18:37:54 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2018-03-03 18:37:54 +0300 |
commit | b889e7fe2d2b1162bad9cf39831e1becf3d9e480 (patch) | |
tree | b733858909539a3b2a674c53544d83d2a74f0332 /src/unittests/utils/itemxmlutils.cc | |
parent | 77b2116504635c855c357dbabb9dd1e7f6620a75 (diff) | |
download | manaverse-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.gz manaverse-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.bz2 manaverse-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.tar.xz manaverse-b889e7fe2d2b1162bad9cf39831e1becf3d9e480.zip |
Fix memory leak in unit tests.
Diffstat (limited to 'src/unittests/utils/itemxmlutils.cc')
-rw-r--r-- | src/unittests/utils/itemxmlutils.cc | 9 |
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); |