gfx-rs / gfx

[maintenance mode] A low-overhead Vulkan-like GPU API for Rust.
http://gfx-rs.github.io/
Apache License 2.0
5.35k stars 551 forks source link

Fix crash when GfxManagedMetalLayerDelegate's backing Objective-C class has already been registered #3780

Closed yamadapc closed 2 years ago

yamadapc commented 2 years ago

Fixes a crash when GfxManagedMetalLayerDelegate objective-c class is already registered.

I'm sure there's a better solution, let me describe the issue:

I really don't know what this code is trying to do, but as far as registering the objective-c class decl, I suppose there're a couple of options:

Let me know what you think & I'm happy to change the PR to go with another option. I suppose an unique class name is a good way to avoid problems, but that can be a bit messy if this class decl will be read somewhere else by name.

PR checklist:

kvark commented 2 years ago

thank you! bors r+

bors[bot] commented 2 years ago

Build succeeded: