diff options
Diffstat (limited to 'core/object')
-rw-r--r-- | core/object/class_db.cpp | 12 | ||||
-rw-r--r-- | core/object/class_db.h | 3 |
2 files changed, 4 insertions, 11 deletions
diff --git a/core/object/class_db.cpp b/core/object/class_db.cpp index 6bc6d653d1..375ad8fae1 100644 --- a/core/object/class_db.cpp +++ b/core/object/class_db.cpp @@ -983,9 +983,9 @@ void ClassDB::add_property_subgroup(StringName p_class, const String &p_name, co // NOTE: For implementation simplicity reasons, this method doesn't allow setters to have optional arguments at the end. void ClassDB::add_property(StringName p_class, const PropertyInfo &p_pinfo, const StringName &p_setter, const StringName &p_getter, int p_index) { - lock->read_lock(); + lock.read_lock(); ClassInfo *type = classes.getptr(p_class); - lock->read_unlock(); + lock.read_unlock(); ERR_FAIL_COND(!type); @@ -1541,11 +1541,7 @@ Variant ClassDB::class_get_default_property_value(const StringName &p_class, con return var; } -RWLock *ClassDB::lock = nullptr; - -void ClassDB::init() { - lock = RWLock::create(); -} +RWLock ClassDB::lock; void ClassDB::cleanup_defaults() { default_values.clear(); @@ -1568,8 +1564,6 @@ void ClassDB::cleanup() { classes.clear(); resource_base_extensions.clear(); compat_classes.clear(); - - memdelete(lock); } // diff --git a/core/object/class_db.h b/core/object/class_db.h index 0591676b92..6fd5748dbb 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -146,7 +146,7 @@ public: return memnew(T); } - static RWLock *lock; + static RWLock lock; static HashMap<StringName, ClassInfo> classes; static HashMap<StringName, StringName> resource_base_extensions; static HashMap<StringName, StringName> compat_classes; @@ -387,7 +387,6 @@ public: static void get_extensions_for_type(const StringName &p_class, List<String> *p_extensions); static void add_compatibility_class(const StringName &p_class, const StringName &p_fallback); - static void init(); static void set_current_api(APIType p_api); static APIType get_current_api(); |