cacao: webview crashes when used from two different bundles
i’m building two different “formats” of my app (they’re audio plug-ins) as separate plugin bundles. when loading both bundles together in a host application, both of them crash simultaneously. the following unwrap() seems to be causing the crash: https://github.com/ryanmcgrath/cacao/blob/trunk/src/webview/class.rs#L194
if i’ve understood correctly, this is just where the class in question gets declared (not even initialised), so might the crash happen when trying to declare the class when it’s already declared? any other ideas?
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 30 (30 by maintainers)
Commits related to this issue
- Refactor foundation/class to support finding classes across multiple bundles (issue #63) — committed to ryanmcgrath/cacao by ryanmcgrath 2 years ago
- Update webview implementation to use load_or_register_class (Issue #63) — committed to ryanmcgrath/cacao by ryanmcgrath 2 years ago
- Experiment with bundle identifier being attached to generated subclass names (Issue #63) — committed to ryanmcgrath/cacao by ryanmcgrath 2 years ago
- Generate a random u64 to append to subclass names (Issue #63) — committed to ryanmcgrath/cacao by ryanmcgrath 2 years ago
Cool! I’ll merge these changes next chance I get, but there’s some other PRs that I’ve been horribly neglectful of that I’d like to get to first - so if you’re cool to use that branch for now…
Glad we got to the bottom of this, and thanks for the odd use-case to test against!
Heh, I guess that’s not surprising… I wonder if there’s some logic towards add a
bundledfeature flag, and then it just appends a_{bundle}to the subclass name? That’s still duplication, but ultimately it shouldn’t be that bad I don’t think… since this is somewhat of a corner case, and it’s at best just doing duplication per bundle.(I can update the branch for this in a bit if you’d wanna try it out)
Yeah, I contemplated doing this… but it feels like ignoring the root cause (which I still don’t understand, frankly). 😦
Would you give the
feat/change-objc-classdecbranch a whirl? I refactored the class loading/register logic to check the runtime if there’s no record held for it, and updated the Webview component to route through that method as well. I think this should solve your issue, but lemme know~