mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-22 21:30:44 +02:00
fix(clipboard-manager): Drop on exit (#2280)
* fix(clipboard-manager): Drop on exit ref https://docs.rs/arboard/latest/arboard/struct.Clipboard.html ref https://github.com/tauri-apps/plugins-workspace/issues/2267 * more specific
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
|
||||
use tauri::{
|
||||
plugin::{Builder, TauriPlugin},
|
||||
Manager, Runtime,
|
||||
Manager, RunEvent, Runtime,
|
||||
};
|
||||
|
||||
#[cfg(desktop)]
|
||||
@@ -59,5 +59,11 @@ pub fn init<R: Runtime>() -> TauriPlugin<R> {
|
||||
app.manage(clipboard);
|
||||
Ok(())
|
||||
})
|
||||
.on_event(|_app, _event| {
|
||||
#[cfg(desktop)]
|
||||
if let RunEvent::Exit = _event {
|
||||
_app.clipboard().cleanup();
|
||||
}
|
||||
})
|
||||
.build()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user