1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

eframe: Use objc2 and its framework crates (#4395)

These are a replacement to the `objc` and `cocoa` crates.

This PR prevents:
- An extra copy when creating `NSData`
- A memory leak when creating `NSImage`
- A memory leak when creating `NSString`

And is generally a readability improvement.

Note that we define `NSApp` manually for now, the implementation in
`objc2-app-kit` is currently suboptimal and wouldn't allow you to check
whether the NSApplication has been created or not.

Related: https://github.com/emilk/egui/issues/4219, this should nicely
coincide with the Winit `0.30` release.

---------

Co-authored-by: Emil Ernerfeldt <emil.ernerfeldt@gmail.com>
This commit is contained in:
Mads Marquart
2024-04-23 17:35:12 +02:00
committed by GitHub
parent 2c590636b5
commit 14194f5d3a
4 changed files with 99 additions and 63 deletions

View File

@@ -47,6 +47,7 @@ deny = [
skip = [
{ name = "bitflags" }, # old 1.0 version via glutin, png, spirv, …
{ name = "block2" }, # old version via glutin->icrate
{ name = "event-listener" }, # TODO(emilk): rustls pulls in two versions of this 😭
{ name = "libloading" }, # wgpu-hal itself depends on 0.8 while some of its dependencies, like ash and d3d12, depend on 0.7
{ name = "memoffset" }, # tiny dependency
@@ -61,7 +62,7 @@ skip = [
skip-tree = [
{ name = "criterion" }, # dev-dependency
{ name = "fastrand" }, # old version via accesskit_unix
{ name = "foreign-types" }, # small crate. Old version via cocoa and core-graphics (winit).
{ name = "foreign-types" }, # small crate. Old version via core-graphics (winit).
{ name = "objc2" }, # old version via accesskit_macos
{ name = "polling" }, # old version via accesskit_unix
{ name = "rfd" }, # example dependency