diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2022-05-27 16:26:01 +0200 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2022-05-27 16:26:01 +0200 |
commit | 8dc03eedfcf24be94f0255c0c9e055dbb83ea092 (patch) | |
tree | 4b032f5b17df8da8acb2e41de99afc78a3bcebe2 /src/entity.cpp | |
parent | update readme (diff) | |
download | threshold-8dc03eedfcf24be94f0255c0c9e055dbb83ea092.tar.gz threshold-8dc03eedfcf24be94f0255c0c9e055dbb83ea092.tar.bz2 threshold-8dc03eedfcf24be94f0255c0c9e055dbb83ea092.tar.xz threshold-8dc03eedfcf24be94f0255c0c9e055dbb83ea092.tar.zst threshold-8dc03eedfcf24be94f0255c0c9e055dbb83ea092.zip |
less leaks and effective-c++-compatible
Diffstat (limited to 'src/entity.cpp')
-rw-r--r-- | src/entity.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/entity.cpp b/src/entity.cpp index 05dc270..409b67f 100644 --- a/src/entity.cpp +++ b/src/entity.cpp @@ -43,4 +43,10 @@ Entity::Entity(int const& h) : hp(h) { threshold = false; } -Entity::~Entity() {} +Entity::~Entity() +{ + for (auto it = wp.begin(); it != wp.end(); ++it) + { + delete it->second; + } +} |