From a6ab69e043df309462393fd899f54414cbbfe955 Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Fri, 10 Apr 2020 20:15:05 +0200 Subject: [PATCH] Fixed EffectParameter memory leak. --- src/Library/EffectParameter.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Library/EffectParameter.hpp b/src/Library/EffectParameter.hpp index b514cba..5093aab 100644 --- a/src/Library/EffectParameter.hpp +++ b/src/Library/EffectParameter.hpp @@ -23,6 +23,12 @@ namespace CreatureLib::Library { EffectParameter(const EffectParameter& other) = delete; EffectParameter& operator=(const EffectParameter& other) = delete; + ~EffectParameter() { + if (_type == EffectParameterType::String) { + delete[](char*) _val; + } + } + EffectParameterType GetType() const noexcept { return _type; } bool AsBool() const { if (_type != EffectParameterType::Bool) {