Merge pull request #333 from sheepandshepherd/string-plus-leak

Fix String::operator+ memory leak
pull/356/head
Rémi Verschelde 2020-01-19 23:35:06 +01:00 committed by GitHub
commit 81783c6045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -124,8 +124,8 @@ bool String::operator!=(const String &s) const {
} }
String String::operator+(const String &s) const { String String::operator+(const String &s) const {
String new_string = *this; String new_string;
new_string._godot_string = godot::api->godot_string_operator_plus(&new_string._godot_string, &s._godot_string); new_string._godot_string = godot::api->godot_string_operator_plus(&_godot_string, &s._godot_string);
return new_string; return new_string;
} }