let app_window = AppWindow::new()?;
app_window.window().on_close_requested(|| {
// Ignore that this is here, it's actually in a completely different part of
// my program, but for simplicity I have it here.
let _ = slint::quit_event_loop();
CloseRequestResponse::HideWindow
});
std::thread::spawn({
let handle = app_window.as_ref();
move || {
std::thread::sleep(Duration::from_secs(1));
handle.upgrade_in_event_loop(|handle| {
handle.show().unwrap();
}).unwrap();
}
})
slint::run_event_loop_until_quit()?;
Once I close the window to trigger slint::quit_event_loop(), the program exits as expected (with exit code 0), but emits the following error message, which I assume is coming from QT:
QObject::~QObject: Timers cannot be stopped from another thread
I also once saw the following message instead, though I couldn't reproduce that since:
Given the following (overly simplified) example:
Once I close the window to trigger
slint::quit_event_loop()
, the program exits as expected (with exit code0
), but emits the following error message, which I assume is coming from QT:QObject::~QObject: Timers cannot be stopped from another thread
I also once saw the following message instead, though I couldn't reproduce that since:
QMutex: destroying locked mutex