From 8dc03eedfcf24be94f0255c0c9e055dbb83ea092 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Fri, 27 May 2022 16:26:01 +0200 Subject: less leaks and effective-c++-compatible --- src/entity.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/entity.cpp') 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; + } +} -- cgit v1.2.3