Fixed EffectParameter memory leak.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-04-10 20:15:05 +02:00
parent d2320fde3c
commit a6ab69e043
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 6 additions and 0 deletions

View File

@ -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) {