used godot_string_new_copy to copy

pull/567/head
DhruvMaroo 2021-05-31 09:31:11 +05:30
parent b44b98a94c
commit 67e2c6145c
1 changed files with 2 additions and 2 deletions

View File

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