mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
GDExtension: Prevent crash during shutdown as singletons are deleted
This commit is contained in:
@@ -384,6 +384,12 @@ Engine::Engine() {
|
||||
singleton = this;
|
||||
}
|
||||
|
||||
Engine::~Engine() {
|
||||
if (singleton == this) {
|
||||
singleton = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
Engine::Singleton::Singleton(const StringName &p_name, Object *p_ptr, const StringName &p_class_name) :
|
||||
name(p_name),
|
||||
ptr(p_ptr),
|
||||
|
||||
Reference in New Issue
Block a user