summaryrefslogtreecommitdiffstats
path: root/core/object/class_db.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <remi@verschelde.fr>2021-01-22 14:51:05 +0100
committerGitHub <noreply@github.com>2021-01-22 14:51:05 +0100
commitd39f6386ce3a7916dbb94fef5ff65e7599e060f0 (patch)
tree3bfc4261f2d9bbfcc7425d29a829a3c5d6d73fc7 /core/object/class_db.cpp
parent2a3e771f4cb2b01d6cbd4bf09e1fbd27e3b019c0 (diff)
parent8ed259b792f3a94939422384c829a6c6973afec8 (diff)
downloadredot-engine-d39f6386ce3a7916dbb94fef5ff65e7599e060f0.tar.gz
Merge pull request #45314 from RandomShaper/modernize_rwlock
Modernize RWLock
Diffstat (limited to 'core/object/class_db.cpp')
-rw-r--r--core/object/class_db.cpp12
1 files changed, 3 insertions, 9 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);
}
//