I worked it out with a co-worker. It turns out the following was happening:
Main thread started sub-thread.
Main thread called stop on thread after receiving a specific signal. (In this case it was looking for a specific value)
My main thread called start on it again a couple function calls later.
The problem was: The main thread never checked to make sure the sub-thread was stopped before moving on. So I got into situations where I was trying to start a thread that was still in the process of stopping.
I solved it with a simple while loop after the stop commands:
Qt Code:
while(subThread->isRunning()) { msleep(1); }To copy to clipboard, switch view to plain text mode




Reply With Quote
Bookmarks