Nothing Special   »   [go: up one dir, main page]

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

Permit multiple Webview instances #20

Merged
merged 1 commit into from
Jan 5, 2024
Merged

Conversation

toshaf
Copy link
Contributor
@toshaf toshaf commented Jan 3, 2024

I really like fltk-rs and I'm hoping to be able to use it more. The one thing I ran into was creating multiple webview instances.

Only the first call to objc_allocateClassPair for a given name will succeed; subsequent calls return nil (nullptr), resulting in a segfault.

This is a low tech approach to getting around this restriction; there are undoubtedly more 'proper' ways of going about this but it works.

This change in its current form may or may not be acceptable to you; I'm using it locally and it works but you may have a preferred way of unblocking the same functionality. Either way, I'd be happy to help get the change in.

All the best

Tosh

Only the first call to `objc_allocateClassPair` for a given name will
succeed; subsequent calls return `nil` (`nullptr`), resulting in a
segfault.

This is a low tech approach to getting around this restriction; there
are undoubtedly more 'proper' ways of going about this but it works.
@MoAlyousef MoAlyousef merged commit 96f12cd into fltk-rs:main Jan 5, 2024
1 of 3 checks passed
@MoAlyousef
Copy link
Collaborator

Hello
Thanks for this PR :)

@MoAlyousef
Copy link
Collaborator
MoAlyousef commented Jan 6, 2024

I've updated the webview component, and now it seems to have logic which would prevent the issue:
https://github.com/webview/webview/blob/f699fb57f922d028440b99b22154a16b2cfb3e77/webview.h#L1180

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants