GoldenCheetah/GoldenCheetah — pull request #597 by dresco (2013-05-12 13:27:07+00:00)
Title: Attempt to fix intermittent segfault at end of workout

There is an intermittent segfault in ANTLogger::logRawAntMessage() at
the end of a workout. When this occurs it seems that the message data
can not be read.

This commit just adds a 500ms delay before closing the ANT worker thread,
which should allow any queued messages to be written to the log file
before the thread terminates.

----------

This only happens right at the end of the workout when the ANT worker thread is closed, so am assuming the message data is being lost when the thread that posted it is terminated.

But I must confess I'm not very clear on how Qt signals / slots work, as I thought the data could be dereferenced once sent by the thread that emits it?

Anyway the issue is intermittent enough that I've not been able to prove whether this fixes it conclusively, but it does allow any outstanding messages to be written to the debug log before the ANT thread is terminated.