From 8230040b765f5011276d26a2cea6dab7b99bc6e1 Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Fri, 21 Nov 2025 21:20:20 +0100 Subject: [PATCH] Fixed CI errors --- src/main.cpp | 9 +++++++-- src/util.cpp | 6 +++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 5bf48e4..18245e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -237,7 +237,7 @@ static p2pool::Params get_params(int argc, const char* const argv[]) noexcept if ((arg.size() > 2) && (arg[0] == '-') && (arg[1] == '-')) { // Store the parameter name without the "--" prefix arg.remove_prefix(2); - args.emplace_back(std::vector(1, std::string(arg))); + args.emplace_back(1, std::string(arg)); } else if (!args.empty()) { args.back().emplace_back(std::move(arg)); @@ -315,6 +315,9 @@ int main(int argc, char* argv[]) memory_tracking_start(); + int result; + { + // Create the default libuv loop and initialize libuv here // It will call the important stuff like WSAStartup and many other things // Some P2Pool code will not work without libuv initialized, so the code above this line must be minimal @@ -334,7 +337,7 @@ int main(int argc, char* argv[]) p2pool::init_crypto_cache(); - int result = static_cast(curl_global_init_mem(CURL_GLOBAL_ALL, p2pool::malloc_hook, p2pool::free_hook, p2pool::realloc_hook, p2pool::strdup_hook, p2pool::calloc_hook)); + result = static_cast(curl_global_init_mem(CURL_GLOBAL_ALL, p2pool::malloc_hook, p2pool::free_hook, p2pool::realloc_hook, p2pool::strdup_hook, p2pool::calloc_hook)); if (result != CURLE_OK) { return result; } @@ -378,6 +381,8 @@ int main(int argc, char* argv[]) uv_library_shutdown(); #endif + } + if (!memory_tracking_stop()) { result = 1; } diff --git a/src/util.cpp b/src/util.cpp index be03217..41ac1f1 100644 --- a/src/util.cpp +++ b/src/util.cpp @@ -1070,7 +1070,7 @@ std::vector> parse_config(const std::string& file_name) case BEFORE_NAME: if (is_alpha(c)) { state = NAME; - args.emplace_back(std::vector(1, std::string(1, c))); + args.emplace_back(1, std::string(1, c)); } else if (c == '#') { state = COMMENT; @@ -1100,10 +1100,10 @@ std::vector> parse_config(const std::string& file_name) state = VALUE; quoted = (c == '"'); if (quoted) { - args.back().emplace_back(std::string()); + args.back().emplace_back(); } else { - args.back().emplace_back(std::string(1, c)); + args.back().emplace_back(1, c); } } break;