diff options
author | sheepandshepherd <sheepandshepherd@hotmail.com> | 2019-10-05 01:14:23 +0200 |
---|---|---|
committer | sheepandshepherd <sheepandshepherd@hotmail.com> | 2019-10-05 01:14:23 +0200 |
commit | 9560cbff096caf1720d15ea6d8b77193c9cdda0a (patch) | |
tree | 27d0dbd09ed27765ea1e0ac787b1374796c5847d /src/core/String.cpp | |
parent | 123d9f0e9264dcc7206888fc96419b32feef00c8 (diff) | |
download | redot-cpp-9560cbff096caf1720d15ea6d8b77193c9cdda0a.tar.gz |
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; } |