summaryrefslogtreecommitdiff
path: root/core/config
diff options
context:
space:
mode:
Diffstat (limited to 'core/config')
-rw-r--r--core/config/engine.cpp11
-rw-r--r--core/config/engine.h5
-rw-r--r--core/config/project_settings.cpp4
-rw-r--r--core/config/project_settings.h3
4 files changed, 12 insertions, 11 deletions
diff --git a/core/config/engine.cpp b/core/config/engine.cpp
index b0037ffb37..26f8cdf840 100644
--- a/core/config/engine.cpp
+++ b/core/config/engine.cpp
@@ -219,3 +219,14 @@ Engine *Engine::get_singleton() {
Engine::Engine() {
singleton = this;
}
+
+Engine::Singleton::Singleton(const StringName &p_name, Object *p_ptr) :
+ name(p_name),
+ ptr(p_ptr) {
+#ifdef DEBUG_ENABLED
+ Reference *ref = Object::cast_to<Reference>(p_ptr);
+ if (ref && !ref->is_referenced()) {
+ WARN_PRINT("You must use Ref<> to ensure the lifetime of a Reference object intended to be used as a singleton.");
+ }
+#endif
+}
diff --git a/core/config/engine.h b/core/config/engine.h
index 1d3d963b39..0d9aa02f28 100644
--- a/core/config/engine.h
+++ b/core/config/engine.h
@@ -41,10 +41,7 @@ public:
struct Singleton {
StringName name;
Object *ptr;
- Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr) :
- name(p_name),
- ptr(p_ptr) {
- }
+ Singleton(const StringName &p_name = StringName(), Object *p_ptr = nullptr);
};
private:
diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp
index aa954ed300..8b8aff3e9e 100644
--- a/core/config/project_settings.cpp
+++ b/core/config/project_settings.cpp
@@ -524,10 +524,6 @@ bool ProjectSettings::has_setting(String p_var) const {
return props.has(p_var);
}
-void ProjectSettings::set_registering_order(bool p_enable) {
- registering_order = p_enable;
-}
-
Error ProjectSettings::_load_settings_binary(const String &p_path) {
Error err;
FileAccess *f = FileAccess::open(p_path, FileAccess::READ, &err);
diff --git a/core/config/project_settings.h b/core/config/project_settings.h
index a8c9adc587..5a16248c76 100644
--- a/core/config/project_settings.h
+++ b/core/config/project_settings.h
@@ -76,7 +76,6 @@ protected:
}
};
- bool registering_order = true;
int last_order = NO_BUILTIN_ORDER_BASE;
int last_builtin_order = 0;
Map<StringName, VariantContainer> props;
@@ -160,8 +159,6 @@ public:
bool is_using_datapack() const;
- void set_registering_order(bool p_enable);
-
bool has_custom_feature(const String &p_feature) const;
Map<StringName, AutoloadInfo> get_autoload_list() const;