fix(core): command stack overflow on Windows, closes #4548 (#4562)

This commit is contained in:
Lucas Fernandes Nogueira 2022-07-03 21:37:49 -03:00 committed by GitHub
parent 23d3d847d1
commit 7e3ac8475c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
"tauri": patch
---
Fix stack overflow on Windows on commands by changing the implementation of the `async_runtime::spawn` method.

View File

@ -103,7 +103,10 @@ impl Runtime {
F::Output: Send + 'static,
{
match self {
Self::Tokio(r) => JoinHandle::Tokio(r.spawn(task)),
Self::Tokio(r) => {
let _guard = r.enter();
JoinHandle::Tokio(tokio::spawn(task))
}
}
}
@ -193,7 +196,10 @@ impl RuntimeHandle {
F::Output: Send + 'static,
{
match self {
Self::Tokio(h) => JoinHandle::Tokio(h.spawn(task)),
Self::Tokio(h) => {
let _guard = h.enter();
JoinHandle::Tokio(tokio::spawn(task))
}
}
}