Browse Source

used godot_string_new_copy to copy

DhruvMaroo 4 years ago
parent
commit
67e2c6145c
1 changed files with 2 additions and 2 deletions
  1. 2 2
      src/core/String.cpp

+ 2 - 2
src/core/String.cpp

@@ -74,7 +74,7 @@ String::String(const String &other) {
 }
 
 String::String(String&& other) {
-	_godot_string = other._godot_string;
+	godot::api->godot_string_new_copy(&_godot_string, &other._godot_string);
 }
 
 String::~String() {
@@ -100,7 +100,7 @@ void String::operator=(const String &s) {
 
 void String::operator=(String&& s) {
 	godot::api->godot_string_destroy(&_godot_string);
-	_godot_string = s._godot_string;
+	godot::api->godot_string_new_copy(&_godot_string, &s._godot_string);
 }
 
 bool String::operator==(const String &s) const {