diff --git a/mm2src/mm2_main/src/mm2.rs b/mm2src/mm2_main/src/mm2.rs index d8d02cedb4..395483cd77 100644 --- a/mm2src/mm2_main/src/mm2.rs +++ b/mm2src/mm2_main/src/mm2.rs @@ -162,6 +162,7 @@ pub async fn lp_main( .into_mm_arc(); ctx_cb(try_s!(ctx.ffi_handle())); + // It's important to spawn this task as soon as `Ctx` is in the correct state. #[cfg(not(target_arch = "wasm32"))] spawn_ctrl_c_handler(ctx.clone());