Possible Bug in Thread::isThreadRunning


The code was built on the windows platform with VC++ 8, using the latest version of Juce. My app called Thread::isThreadRunning on a thread instance that was never started. It returned true instead of false because Thread::threadHandle_ was set to 0xfeeefeee which is what windows initializes unallocated memory when running in the debug configuration.


That variable gets initialised to 0, so your diagnosis sounds fishy to me… Maybe your thread object is a dangling pointer or something?


I think 0xfeeefeee actually means that the memory has been freed; sort of a hexadecimal pun.


Matt, I think you’re right. It turned out that my ordering of destructors was incorrect: my code deleted an object whose thread is later stopped by a destructor of an object using the thread.