Skip to content

Commit

Permalink
add explicit deleting of variant string
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienDoerner committed Sep 5, 2024
1 parent e8f373f commit 84581dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Variant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ Variant::Variant(const char* s) {

Variant::~Variant() {
clear(type);
delete data._t_string;
}

const char* Variant::getTypeName() const {
Expand Down Expand Up @@ -676,7 +677,7 @@ Variant Variant::fromString(const std::string& s, Type t) {
}

void Variant::clear(Type t) {
if (t == TYPE_STRING)
if (t == TYPE_STRING)
safeDelete(data._t_string);
else if (t == TYPE_VECTOR3F)
safeDelete(data._t_vector3f);
Expand Down

0 comments on commit 84581dd

Please sign in to comment.