Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release Engine after unregistering GDExtensions #92060

Merged
merged 1 commit into from
May 18, 2024

Conversation

raulsntos
Copy link
Member

The Engine is used to retrieve singletons, and GDExtensions may try to retrieve a singleton (e.g.: OS) in their deinitialization.

MRP: https://github.com/raulsntos/GDExtensionSingletonCrash

The MRP shows the following errors and then crashes:

ERROR: Failed to retrieve non-existent singleton 'OS'.
   at: get_singleton_object (core/config/engine.cpp:294)
ERROR: Parameter "singleton_obj" is null.
   at: get_singleton (godot-cpp/gen/src/classes/os.cpp:47)

The Engine is used to retrieve singletons, and GDExtensions may try to retrieve a singleton (e.g.: `OS`) in their deinitialization.
@raulsntos raulsntos added this to the 4.x milestone May 17, 2024
@raulsntos raulsntos requested a review from a team May 17, 2024 20:15
@raulsntos raulsntos requested a review from a team as a code owner May 17, 2024 20:15
Copy link
Contributor

@dsnopek dsnopek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense to me.

Engine is created before initialize_modules(MODULE_INITIALIZATION_LEVEL_CORE), so it would make sense that it's deleted after uninitialize_modules(MODULE_INITIALIZATION_LEVEL_CORE), since we want to clean things up in basically the reverse order that we created them.

@akien-mga akien-mga modified the milestones: 4.x, 4.3 May 17, 2024
@akien-mga akien-mga merged commit 7437b9a into godotengine:master May 18, 2024
16 checks passed
@akien-mga
Copy link
Member

Thanks!

@raulsntos raulsntos deleted the core/memdelete-engine-later branch May 18, 2024 16:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants