Skip to content

Send NOTIFICATION_POSTINITIALIZE to extension classes#1321

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
dsnopek:postinitialize
Nov 30, 2023
Merged

Send NOTIFICATION_POSTINITIALIZE to extension classes#1321
akien-mga merged 1 commit into
godotengine:masterfrom
dsnopek:postinitialize

Conversation

@dsnopek

@dsnopek dsnopek commented Nov 29, 2023

Copy link
Copy Markdown
Collaborator

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
@akien-mga

Copy link
Copy Markdown
Member

Thanks!

@dsnopek

dsnopek commented Jan 22, 2024

Copy link
Copy Markdown
Collaborator Author

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