Issue with StopThread

I have been using Juce on a project for over a year and I updated and it just starting EXC_BAD_ACCESS when I call stopThread().  Before I call stop thread() I am setting a variable which should exit the loop anyway (and this is working - I have always also called stopThread(1000) after just to make sure).  The issue is in Thread::closeThreadHandle() threadId.  threadId at this point points to 0x0.  Although, sometimes the error is in Thread::threadEntryPoint()  

currentThreadHolder->value.releaseCurrentThreadStorage();

The issue seems to be that it is stopping from natural causes and by me calling stopTread(1000) (both of which are cleaning up at the same time).  I have never had an issue with this before and I did not see any changes in the Juce code tree that were made that could affect this.

If I do not call stopThread(withsomewait), it is not always finished in time and I get an assertion error (bad karma) occsasionally.

Any Ideas?

Thanks,
Darren
 

This isn't anything that's wrong or changed in the library, you just need to make sure you handle your object lifetimes correctly and don't go calling methods on a null pointer!

Very hard to give more specific advice - it's up to you to figure out what's the most appropriate way to handle objects based on what you're trying to do.

Jules,

My bad, the issue is with an ffmpeg library underneath (this should be fun to find).   Anyway,  this gave me an excuse to clean up my code a bit.

As always, thanks for being so responsive.

Darren