Skip to content

[iOS] Fix initialisation/termination of multiple statically linked extensions.#1316

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
bruvzg:static_multiple_init
Nov 24, 2023
Merged

[iOS] Fix initialisation/termination of multiple statically linked extensions.#1316
akien-mga merged 1 commit into
godotengine:masterfrom
bruvzg:static_multiple_init

Conversation

@bruvzg

@bruvzg bruvzg commented Nov 22, 2023

Copy link
Copy Markdown
Member

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

@dsnopek dsnopek left a comment

Copy link
Copy Markdown
Collaborator

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

abcjjy commented Nov 23, 2023

Copy link
Copy Markdown

Will this be in v4.2?

@abcjjy

abcjjy commented Nov 23, 2023

Copy link
Copy Markdown

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

bruvzg commented Nov 23, 2023

Copy link
Copy Markdown
Member Author

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

abcjjy commented Nov 24, 2023

Copy link
Copy Markdown

This works.

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

Copy link
Copy Markdown
Member

Thanks!

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

dsnopek commented Jan 22, 2024

Copy link
Copy Markdown
Collaborator

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