From b44b98a94c564a6eeb619c476ea2a3a75e1e6297 Mon Sep 17 00:00:00 2001 From: DhruvMaroo Date: Mon, 31 May 2021 09:10:59 +0530 Subject: [PATCH] removed _deleted class member --- include/core/String.hpp | 1 - src/core/String.cpp | 7 +------ 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/include/core/String.hpp b/include/core/String.hpp index 4992adb..fa3944d 100644 --- a/include/core/String.hpp +++ b/include/core/String.hpp @@ -17,7 +17,6 @@ class CharString { friend class String; godot_char_string _char_string; - bool _deleted = false; public: ~CharString(); diff --git a/src/core/String.cpp b/src/core/String.cpp index 04b7387..68ead4d 100644 --- a/src/core/String.cpp +++ b/src/core/String.cpp @@ -75,14 +75,10 @@ String::String(const String &other) { String::String(String&& other) { _godot_string = other._godot_string; - other._deleted = true; } String::~String() { - if (!_deleted) { - godot::api->godot_string_destroy(&_godot_string); - _deleted = true; - } + godot::api->godot_string_destroy(&_godot_string); } wchar_t &String::operator[](const int idx) { @@ -105,7 +101,6 @@ void String::operator=(const String &s) { void String::operator=(String&& s) { godot::api->godot_string_destroy(&_godot_string); _godot_string = s._godot_string; - s._deleted = true; } bool String::operator==(const String &s) const {