mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-16 21:05:29 +02:00
fix(store): apply_pending_auto_save can deadlock (#3572)
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
---
|
||||
"store": patch
|
||||
"store-js": patch
|
||||
---
|
||||
|
||||
Fix `apply_pending_auto_save` can deadlock the store
|
||||
@@ -600,7 +600,8 @@ impl<R: Runtime> Store<R> {
|
||||
|
||||
fn apply_pending_auto_save(&self) {
|
||||
// Cancel and save if auto save is pending
|
||||
if let Some(sender) = self.auto_save_debounce_sender.lock().unwrap().take() {
|
||||
let auto_save_debounce_sender = self.auto_save_debounce_sender.lock().unwrap().take();
|
||||
if let Some(sender) = auto_save_debounce_sender {
|
||||
let _ = sender.send(AutoSaveMessage::Cancel);
|
||||
let _ = self.save();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user