Skip to content

Conversation

@bruvzg
Copy link
Member

@bruvzg bruvzg commented Nov 22, 2023

Fixes godotengine/godot#85210, with a statically linked extensions this part is shared between all extensions and therefor can use static variables.

@bruvzg bruvzg requested a review from a team as a code owner November 22, 2023 13:05
@dsnopek dsnopek added the bug This has been identified as a bug label Nov 22, 2023
@dsnopek dsnopek added this to the 4.x milestone Nov 22, 2023
Copy link
Collaborator

@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.

Thanks! This looks good to me :-)

@abcjjy
Copy link

abcjjy commented Nov 23, 2023

Will this be in v4.2?

@abcjjy
Copy link

abcjjy commented Nov 23, 2023

The static init_callback is called for every loaded extensions. Then every extension's initializer is called multiple times.

Why not use a member variable for init_callback?

@bruvzg bruvzg marked this pull request as draft November 23, 2023 07:13
@bruvzg
Copy link
Member Author

bruvzg commented Nov 23, 2023

The static init_callback is called for every loaded extensions. Then every extension's initializer is called multiple times.

Yes, this seems to be the case. Will fix a bit later.

@bruvzg bruvzg force-pushed the static_multiple_init branch from 2e444e1 to adc9def Compare November 23, 2023 11:38
@bruvzg bruvzg marked this pull request as ready for review November 23, 2023 11:38
@abcjjy
Copy link

abcjjy commented Nov 24, 2023

This works.

@akien-mga akien-mga merged commit 2f16edd into godotengine:master Nov 24, 2023
@akien-mga
Copy link
Member

Thanks!

@akien-mga akien-mga modified the milestones: 4.x, 4.3, 4.2 Dec 1, 2023
@dsnopek
Copy link
Collaborator

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.

Multiple GDExtensions can't be registered in iOS export

4 participants