mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-09-11 07:55:34 +03:00
fix(core): deadlock on plugin webview ready hook (#4462)
This commit is contained in:
parent
13b8a2403d
commit
9d33d09341
5
.changes/fix-plugin-deadlock.md
Normal file
5
.changes/fix-plugin-deadlock.md
Normal file
@ -0,0 +1,5 @@
|
||||
---
|
||||
"tauri": patch
|
||||
---
|
||||
|
||||
Fixes deadlock when a plugin window ready event needs to block the thread waiting on the event loop.
|
@ -1192,14 +1192,16 @@ impl<R: Runtime> WindowManager<R> {
|
||||
}
|
||||
|
||||
// let plugins know that a new window has been added to the manager
|
||||
{
|
||||
self
|
||||
.inner
|
||||
let manager = self.inner.clone();
|
||||
let window_ = window.clone();
|
||||
// run on main thread so the plugin store doesn't dead lock with the event loop handler in App
|
||||
let _ = window.run_on_main_thread(move || {
|
||||
manager
|
||||
.plugins
|
||||
.lock()
|
||||
.expect("poisoned plugin store")
|
||||
.created(window.clone());
|
||||
}
|
||||
.created(window_);
|
||||
});
|
||||
|
||||
window
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user