removed _deleted class member
parent
cd05371ce8
commit
b44b98a94c
|
@ -17,7 +17,6 @@ class CharString {
|
||||||
friend class String;
|
friend class String;
|
||||||
|
|
||||||
godot_char_string _char_string;
|
godot_char_string _char_string;
|
||||||
bool _deleted = false;
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
~CharString();
|
~CharString();
|
||||||
|
|
|
@ -75,14 +75,10 @@ String::String(const String &other) {
|
||||||
|
|
||||||
String::String(String&& other) {
|
String::String(String&& other) {
|
||||||
_godot_string = other._godot_string;
|
_godot_string = other._godot_string;
|
||||||
other._deleted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
String::~String() {
|
String::~String() {
|
||||||
if (!_deleted) {
|
|
||||||
godot::api->godot_string_destroy(&_godot_string);
|
godot::api->godot_string_destroy(&_godot_string);
|
||||||
_deleted = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t &String::operator[](const int idx) {
|
wchar_t &String::operator[](const int idx) {
|
||||||
|
@ -105,7 +101,6 @@ 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_string = s._godot_string;
|
||||||
s._deleted = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool String::operator==(const String &s) const {
|
bool String::operator==(const String &s) const {
|
||||||
|
|
Loading…
Reference in New Issue