diff --git a/source/MaaFramework/API/MaaController.cpp b/source/MaaFramework/API/MaaController.cpp index 97d59f55c..b9cd898ee 100644 --- a/source/MaaFramework/API/MaaController.cpp +++ b/source/MaaFramework/API/MaaController.cpp @@ -17,7 +17,7 @@ MaaControllerHandle MaaAdbControllerCreate(MaaStringView adb_path, MaaStringView << "is about to be deprecated, and we recommend using MaaAdbControllerCreateV2 instead."; constexpr std::string_view kDefaultAgentPath = "./MaaAgentBinary"; - return MaaAdbControllerCreateV2(adb_path, address, type, kDefaultAgentPath.data(), config, callback, callback_arg); + return MaaAdbControllerCreateV2(adb_path, address, type, config, kDefaultAgentPath.data(), callback, callback_arg); } MaaControllerHandle MaaAdbControllerCreateV2(MaaStringView adb_path, MaaStringView address, MaaAdbControllerType type, diff --git a/source/MaaRpc/cli/main.cpp b/source/MaaRpc/cli/main.cpp index bb46b975c..30756fb4e 100644 --- a/source/MaaRpc/cli/main.cpp +++ b/source/MaaRpc/cli/main.cpp @@ -10,12 +10,14 @@ std::mutex mutex; std::condition_variable cv; bool quiet = false; +bool quit = false; void sig_handler(int) { if (!quiet) { std::cout << "Quit from interrupt" << std::endl; } + quit = true; std::unique_lock lock(mutex); cv.notify_all(); } @@ -57,7 +59,7 @@ int main(int argc, char* argv[]) if (!quiet) { std::cout << "Server listening on " << server_address << std::endl; } - cv.wait(lock); + cv.wait(lock, []() { return quit; }); std::cout << "Start stopping" << std::endl; MaaRpcStop();