You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
use tauri_plugin_dialog::{DialogExt,MessageDialogButtons};let window = window.clone();
rayon::spawn(move || {if !window
.app_handle().dialog().message(t!("on_exit")).title("Confirm").buttons(MessageDialogButtons::OkCancel).blocking_show(){return;}}
error:
Panic occurred at 2024-12-12T09:46:16.651081+08:00
panicked at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src/lib.rs:735:8:
state() called before manage() for given type
0: backtrace::backtrace::dbghelp64::trace
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.74\src\backtrace\dbghelp64.rs:91
backtrace::backtrace::trace_unsynchronized<backtrace::capture::impl$4::create::closure_env$0>
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.74\src\backtrace\mod.rs:66
1: backtrace::backtrace::trace<backtrace::capture::impl$4::create::closure_env$0>
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.74\src\backtrace\mod.rs:53
2: backtrace::capture::Backtrace::create
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.74\src\capture.rs:292
3: backtrace::capture::Backtrace::new
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\backtrace-0.3.74\src\capture.rs:257
4: inno_projector::logs::enable_log_panic_info::closure$0
at D:\code\InnoProjector-Tauri\src-tauri\src\logs.rs:12
5: alloc::boxed::impl$50::call
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/alloc\src\boxed.rs:2468
std::panicking::rust_panic_with_hook
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:809
6: std::panicking::begin_panic_handler::closure$0
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:674
7: std::sys::backtrace::__rust_end_short_backtrace<std::panicking::begin_panic_handler::closure_env$0,never$>
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\sys\backtrace.rs:170
8: std::panicking::begin_panic_handler
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\panicking.rs:665
9: core::panicking::panic_fmt
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:74
10: core::panicking::panic_display
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\panicking.rs:264
core::option::expect_failed
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/core\src\option.rs:2021
11: enum2$<core::option::Option<tauri::state::State<tauri_plugin_dialog::desktop::Dialog<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> > > > > >::expect<tauri::state::State<tauri_plugin_dialog::desktop::Dialog<tauri_runtime_wry::Wry<enum2$<tauri::Even
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\option.rs:933
12: tauri::Manager::state<tauri::app::AppHandle<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> > >,tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> >,tauri_plugin_dialog::desktop::Dialog<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> > >
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-2.1.1\src\lib.rs:731
13: tauri_plugin_dialog::impl$0::dialog<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> >,tauri::app::AppHandle<tauri_runtime_wry::Wry<enum2$<tauri::EventLoopMessage> > > >
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\tauri-plugin-dialog-2.2.0\src\lib.rs:70
14: inno_projector::on_close_event::closure$0
at D:\code\InnoProjector-Tauri\src-tauri\src\main.rs:218
15: core::panic::unwind_safe::impl$25::call_once<tuple$<>,inno_projector::on_close_event::closure_env$0>
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272
16: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<inno_projector::on_close_event::closure_env$0>,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:557
17: core::fmt::impl$55::fmt<std::panic::PanicHookInfo>
18: std::panicking::try
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:520
std::panic::catch_unwind<core::panic::unwind_safe::AssertUnwindSafe<inno_projector::on_close_event::closure_env$0>,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
19: rayon_core::unwind::halt_unwinding<inno_projector::on_close_event::closure_env$0,tuple$<> >
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\unwind.rs:17
20: rayon_core::registry::Registry::catch_unwind<inno_projector::on_close_event::closure_env$0>
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:367
21: rayon_core::spawn::spawn_job::closure$0<inno_projector::on_close_event::closure_env$0>
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\spawn\mod.rs:97
22: rayon_core::job::impl$6::execute<rayon_core::spawn::spawn_job::closure_env$0<inno_projector::on_close_event::closure_env$0> >
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\job.rs:169
23: rayon_core::job::JobRef::execute
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\job.rs:64
24: rayon_core::registry::WorkerThread::execute
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:860
25: rayon_core::registry::WorkerThread::wait_until_cold
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:794
26: rayon_core::registry::WorkerThread::wait_until<rayon_core::latch::OnceLatch>
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:769
27: rayon_core::registry::WorkerThread::wait_until_out_of_work
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:818
28: rayon_core::registry::main_loop
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:923
29: rayon_core::registry::ThreadBuilder::run
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:53
30: rayon_core::registry::impl$2::spawn::closure$0
at D:\Scoop\persist\rustup\.cargo\registry\src\index.crates.io-6f17d22bba15001f\rayon-core-1.12.1\src\registry.rs:98
31: core::hint::black_box
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\hint.rs:389
std::sys::backtrace::__rust_begin_short_backtrace<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\sys\backtrace.rs:154
32: std::thread::impl$0::spawn_unchecked_::closure$1::closure$0<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:538
33: core::panic::unwind_safe::impl$25::call_once<tuple$<>,std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> > >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\panic\unwind_safe.rs:272
34: std::panicking::try::do_call<core::panic::unwind_safe::AssertUnwindSafe<std::thread::impl$0::spawn_unchecked_::closure$1::closure_env$0<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> > >,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:557
35: crossbeam_deque::deque::impl$17::default<rayon_core::job::JobRef>
36: std::panicking::try
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panicking.rs:520
std::panic::catch_unwind
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\panic.rs:358
std::thread::impl$0::spawn_unchecked_::closure$1<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\std\src\thread\mod.rs:537
37: core::ops::function::FnOnce::call_once<std::thread::impl$0::spawn_unchecked_::closure_env$1<rayon_core::registry::impl$2::spawn::closure_env$0,tuple$<> >,tuple$<> >
at D:\Scoop\persist\rustup\.rustup\toolchains\stable-x86_64-pc-windows-msvc\lib\rustlib\src\rust\library\core\src\ops\function.rs:250
38: alloc::boxed::impl$48::call_once
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/alloc\src\boxed.rs:2454
alloc::boxed::impl$48::call_once
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/alloc\src\boxed.rs:2454
std::sys::pal::windows::thread::impl$0::new::thread_start
at /rustc/90b35a6239c3d8bdabc530a6a0816f7ff89a0aaf\library/std\src\sys\pal\windows\thread.rs:55
39: BaseThreadInitThunk
40: RtlUserThreadStart
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
my code:
error:
Beta Was this translation helpful? Give feedback.
All reactions