From ece90f975b37ec4d153cf8e45767fda89d3db2e6 Mon Sep 17 00:00:00 2001 From: rakshasa Date: Tue, 20 Mar 2012 23:52:32 +0900 Subject: [PATCH] Initiate worker thread after initializing libtorrent to ensure logging is properly done. --- src/main.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main.cc b/src/main.cc index 2d50006c..796a96a2 100644 --- a/src/main.cc +++ b/src/main.cc @@ -188,9 +188,6 @@ main(int argc, char** argv) { control = new Control; - worker_thread = new ThreadWorker(); - worker_thread->init_thread(); - srandom(cachedTime.usec()); srand48(cachedTime.usec()); @@ -217,6 +214,9 @@ main(int argc, char** argv) { torrent::main_thread()->slot_do_work() = tr1::bind(&client_perform); torrent::main_thread()->slot_next_timeout() = tr1::bind(&client_next_timeout, control); + worker_thread = new ThreadWorker(); + worker_thread->init_thread(); + // Initialize option handlers after libtorrent to ensure // torrent::ConnectionManager* are valid etc. initialize_commands();