Reset pointer on charholder to prevent multiple deletions.
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
49b5e2cfe9
commit
030f82d34f
@ -27,7 +27,11 @@ namespace ArbUt {
|
|||||||
: _value(new char[value.length() + 1]), _references(1) {
|
: _value(new char[value.length() + 1]), _references(1) {
|
||||||
strncpy(_value, value.data(), value.length() + 1);
|
strncpy(_value, value.data(), value.length() + 1);
|
||||||
}
|
}
|
||||||
~__ConstStringCharHolder() { delete[] _value; }
|
|
||||||
|
~__ConstStringCharHolder() noexcept {
|
||||||
|
delete[] _value;
|
||||||
|
_value = nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
inline void RemoveReference() noexcept {
|
inline void RemoveReference() noexcept {
|
||||||
if (--_references <= 0) {
|
if (--_references <= 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user