From 9560cbff096caf1720d15ea6d8b77193c9cdda0a Mon Sep 17 00:00:00 2001 From: sheepandshepherd Date: Sat, 5 Oct 2019 01:14:23 +0200 Subject: [PATCH] Fix String::operator+ memory leak --- src/core/String.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/String.cpp b/src/core/String.cpp index ac197296..7340b6d6 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; }