Workaround libpng crash on macos by not creating NSImage from png data#7252
Workaround libpng crash on macos by not creating NSImage from png data#7252
NSImage from png data#7252Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7252-fix-icon-setting-crash-maybe |
|
Should we decide to merge this, we have to remember to also handle the default icon differently (by including it as a raw image or using the image crate to decode it?) |
|
If I'm not reading this wrong we so far decoded the default icon and then encoded it again... |
|
Fix got confirmed! 🥳 |
|
Not related to your PR, but I noticed that the icon will switch to the terminal icon for a split second when closing the app 🤔 Untitled.movNot a huge problem but it's a bit odd |
On some Macs (OS version dependent?)
NSImagemay load user installed libpng and subsequently crash (likely if they don't expected symbols). This PR works around this by not encoding back to png but instead sending the image over directly. This is strictly speaking better anyways since we don't have to re-encode icons, but is also a bit more cumbersome to do