Reset pointer on charholder to prevent multiple deletions.
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Deukhoofd 2020-06-27 13:59:01 +02:00
parent 49b5e2cfe9
commit 030f82d34f
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 5 additions and 1 deletions

View File

@ -27,7 +27,11 @@ namespace ArbUt {
: _value(new char[value.length() + 1]), _references(1) {
strncpy(_value, value.data(), value.length() + 1);
}
~__ConstStringCharHolder() { delete[] _value; }
~__ConstStringCharHolder() noexcept {
delete[] _value;
_value = nullptr;
}
inline void RemoveReference() noexcept {
if (--_references <= 0) {