diff --git a/winixd/core/basethread.cpp b/winixd/core/basethread.cpp index 151669d..a2d9a6e 100644 --- a/winixd/core/basethread.cpp +++ b/winixd/core/basethread.cpp @@ -254,6 +254,7 @@ void * BaseThread::StartRoutine(void * this_object) } } + base->save_log(); pthread_exit(0); return 0; } diff --git a/winixd/core/threadmanager.cpp b/winixd/core/threadmanager.cpp index 45087e1..d95f884 100644 --- a/winixd/core/threadmanager.cpp +++ b/winixd/core/threadmanager.cpp @@ -186,6 +186,10 @@ void ThreadManager::StopAll() item.object->WaitForThread(); log << log4 << "TM: thread " << id << " terminated" << logend; + // the thread is stopped and we can set the thread log buffer pointing to + // the main log buffer (from the main thread) + item.object->set_log_buffer(log.GetLogBuffer()); + delete item.thread_item_data; id += 1; } diff --git a/winixd/core/winixbase.cpp b/winixd/core/winixbase.cpp index 0cf9132..364532c 100644 --- a/winixd/core/winixbase.cpp +++ b/winixd/core/winixbase.cpp @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2018, Tomasz Sowa + * Copyright (c) 2018-2021, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -90,6 +90,13 @@ void WinixBase::set_dependency(WinixBase * winix_base) +void WinixBase::save_log() +{ + log << logsave; +} + + + } diff --git a/winixd/core/winixbase.h b/winixd/core/winixbase.h index 4bd66a3..2716df0 100644 --- a/winixd/core/winixbase.h +++ b/winixd/core/winixbase.h @@ -5,7 +5,7 @@ */ /* - * Copyright (c) 2018, Tomasz Sowa + * Copyright (c) 2018-2021, Tomasz Sowa * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -65,6 +65,8 @@ public: void set_dependency(WinixBase * winix_base); + void save_log(); + protected: