diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-01-19 23:35:06 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-19 23:35:06 +0100 |
commit | 81783c6045ac5e3638846f791c7c7841db38aa7e (patch) | |
tree | e84d692dc46e3cbbdceea8d51a49bf789511afac /src/core/String.cpp | |
parent | 7cbb846417acf0154a786bcaee8a5b1d7b40df57 (diff) | |
parent | 9560cbff096caf1720d15ea6d8b77193c9cdda0a (diff) | |
download | redot-cpp-81783c6045ac5e3638846f791c7c7841db38aa7e.tar.gz |
Merge pull request #333 from sheepandshepherd/string-plus-leak
Fix String::operator+ memory leak
Diffstat (limited to 'src/core/String.cpp')
-rw-r--r-- | src/core/String.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/String.cpp b/src/core/String.cpp index ac19729..7340b6d 100644 --- a/src/core/String.cpp +++ b/src/core/String.cpp @@ -124,8 +124,8 @@ bool String::operator!=(const String &s) const { } String String::operator+(const String &s) const { - String new_string = *this; - new_string._godot_string = godot::api->godot_string_operator_plus(&new_string._godot_string, &s._godot_string); + String new_string; + new_string._godot_string = godot::api->godot_string_operator_plus(&_godot_string, &s._godot_string); return new_string; } |