Skip to content

Commit

Permalink
Move shutdown message to outer main function
Browse files Browse the repository at this point in the history
This is so that it is easier to tell when the runtime is stuck
(acquiring the loader lock) during shutdown.
  • Loading branch information
ff14wed committed Mar 27, 2023
1 parent 390e3a1 commit 6d68d35
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Expand Up @@ -148,7 +148,7 @@ async fn main_with_result() -> Result<()> {
drop(shutdown_tx);
info!("Shutting down broadcast loop...");
msg_loop_handle.await?;
info!("Shut down!");
info!("Shutting down...");
Ok(())
}

Expand Down Expand Up @@ -220,6 +220,7 @@ unsafe extern "system" fn main(dll_base_addr: LPVOID) -> u32 {
error!("Panic happened: {:?}", cause);
pause();
}
info!("Shut down!");
#[cfg(debug_assertions)]
wincon::FreeConsole();
libloaderapi::FreeLibraryAndExitThread(dll_base_addr as HMODULE, 0);
Expand Down

0 comments on commit 6d68d35

Please sign in to comment.