Open zangdale opened 1 year ago
same issue for me
This is not only limited to set_icon
. I'm noticing similar behavior when calling set_title
and set_menu
.
Currently able to repro on MacOS using Tauri 1.6.7
, where each update I push to my tray adds nearly 1MB of memory that never frees. It's unclear why values passed in to set_icon
+ friends do not properly drop memory after they're replaced. I've dug a bit and haven't found anything so far. I'm wondering if this is happening outside of rust and in the OS bindings instead?
Digging deeper it looks like this may be the cause:
https://github.com/SSheldon/rust-objc/issues/80
Possible alternative here that may solve this in the future https://github.com/tauri-apps/wry/issues/1239
Specifically for tray icon: https://github.com/tauri-apps/tray-icon/pull/172
Describe the bug
I want to change the icon on notifications area, I found that each calling method "app.tray_handle().set_icon(tauri::Icon::Raw(include_bytes!("../icons/2.png").to_vec())).unwrap();" will increase memory.
Reproduction
Continuous calls “set_icon()”
Expected behavior
No memory leaks
Platform and versions
cargo tauri info
Environment › OS: Mac OS 12.6.0 X64 › Node.js: 16.17.0 › npm: 8.15.0 › pnpm: Not installed! › yarn: 1.22.19 › rustup: 1.25.1 › rustc: 1.63.0 › cargo: 1.63.0 › Rust toolchain: stable-x86_64-apple-darwin
Packages › @tauri-apps/cli [NPM]: 1.1.1 › @tauri-apps/api [NPM]: 1.1.0 › tauri [RUST]: 1.1.1, › tauri-build [RUST]: 1.1.0, › tao [RUST]: 0.14.0, › wry [RUST]: 0.21.1,
App › build-type: bundle › CSP: unset › distDir: ../dist › devPath: http://localhost:1420/ › framework: Vue.js
App directory structure ├─ dist ├─ resources ├─ node_modules ├─ public ├─ runcat.app ├─ src-tauri ├─ .git ├─ .vscode ├─ .idea └─ src
Stack trace
No response
Additional context
Other languages have similar problems: https://github.com/getlantern/systray/issues/135