(svn r12257) [NoAI] -Fix: flush stdout and stderr when killing a thread, avoids data-loss ;)
--- a/src/ai/ai_threads.cpp Mon Feb 25 16:26:30 2008 +0000
+++ b/src/ai/ai_threads.cpp Mon Feb 25 16:29:48 2008 +0000
@@ -317,6 +317,12 @@
/*virtual*/ ~AIThread_MT()
{
DEBUG(ai, 3, "-AIThread_MT(%d) from thr %u", this->fiber_id, ThreadObject::CurrentId());
+
+ /* Flush stdout and stderr, as killing the thread doesn't allow the thread
+ * to do that (in case there still is something to print) */
+ fflush(stdout);
+ fflush(stderr);
+
this->evt_go.Detach();
}