From 3860b8e666347af2958abbdbd35d888fa94d1c07 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sat, 18 May 2024 00:11:47 +0500 Subject: FIX: FINALLY SOLVED THE THREAD PROBLEM!!! YIPEE --- src/main.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 88b56cd..3c8f5e7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -114,10 +114,14 @@ int main(int argc, char *argv[]) { client.run(); - std::thread timer_thread(bot::create_timer_thread, &client, &cfg); - timer_thread.join(); + std::vector threads; + threads.push_back(std::thread(bot::create_timer_thread, &client, &cfg)); + threads.push_back(std::thread(&bot::stream::StreamListenerClient::run, + &stream_listener_client)); - stream_listener_client.run_thread(); + for (auto &thread : threads) { + thread.join(); + } return 0; } -- cgit v1.2.3