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

Send NOTIFICATION_POSTINITIALIZE to extension classes #1321

Merged
merged 1 commit into from
Nov 30, 2023

Conversation

dsnopek
Copy link
Collaborator

@dsnopek dsnopek commented Nov 29, 2023

Fixes #1269

This turned out to be a little messier to implement than I had imagined, because in godot-cpp it's Wrapped::_postinitialize() (rather than in Godot where it's Object::_postinitialize()) so it's got to cast the Wrapped * to Object * to send the notification. It's probably safe to assume that all Wrapped * are in fact descended from Object *, but I did a dynamic_cast<Object *>() just to be sure.

This PR includes tests that fail without the fix, and then succeed with it.

@dsnopek dsnopek added bug This has been identified as a bug cherrypick:4.1 labels Nov 29, 2023
@dsnopek dsnopek added this to the 4.x milestone Nov 29, 2023
@dsnopek dsnopek requested a review from a team as a code owner November 29, 2023 18:06
@akien-mga akien-mga modified the milestones: 4.x, 4.2 Nov 30, 2023
@akien-mga akien-mga merged commit 11b2700 into godotengine:master Nov 30, 2023
12 checks passed
@akien-mga
Copy link
Member

Thanks!

@dsnopek
Copy link
Collaborator Author

dsnopek commented Jan 22, 2024

Cherry-picking to 4.1 in #1373

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This has been identified as a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Object does not dispatch NOTIFICATION_POSTINITIALIZE
2 participants