diff --git a/source/MaaHttp/spec/call.hpp b/source/MaaHttp/spec/call.hpp index 9995baaa2..4e7fcc44c 100644 --- a/source/MaaHttp/spec/call.hpp +++ b/source/MaaHttp/spec/call.hpp @@ -133,7 +133,9 @@ auto ctx = manager->query(id); if (!ctx.get()) { return false; } -MaaCustomRecognizerAPI api = { callback::create_callback() }; +static MaaCustomRecognizerAPI api = { + callback::create_callback() +}; std::get(arg) = &api; std::get(arg) = ctx.get(); return true; @@ -157,8 +159,10 @@ if (!stop_ctx.get()) { } auto ctx = provider.get()->alloc( std::vector { run_id, stop_id }); -MaaCustomActionAPI api = { callback::create_callback(), - callback::create_callback() }; +ctx->run = run_ctx; +ctx->stop = stop_ctx; +static MaaCustomActionAPI api = { callback::create_callback(), + callback::create_callback() }; std::get(arg) = &api; std::get(arg) = ctx; return true;