Bug 1048102 - Delete GMPThreads as they're joined. r=jesup

This commit is contained in:
Chris Pearce 2014-08-05 10:18:31 +12:00
parent 3a7f126502
commit 267ba2dd90
2 changed files with 9 additions and 4 deletions

View File

@ -162,10 +162,12 @@ GMPThreadImpl::GMPThreadImpl()
: mMutex("GMPThreadImpl"),
mThread("GMPThread")
{
MOZ_COUNT_CTOR(GMPThread);
}
GMPThreadImpl::~GMPThreadImpl()
{
MOZ_COUNT_DTOR(GMPThread);
}
void
@ -189,10 +191,13 @@ GMPThreadImpl::Post(GMPTask* aTask)
void
GMPThreadImpl::Join()
{
MutexAutoLock lock(mMutex);
if (mThread.IsRunning()) {
mThread.Stop();
{
MutexAutoLock lock(mMutex);
if (mThread.IsRunning()) {
mThread.Stop();
}
}
delete this;
}
GMPMutexImpl::GMPMutexImpl()

View File

@ -50,7 +50,7 @@ class GMPThread {
public:
virtual ~GMPThread() {}
virtual void Post(GMPTask* aTask) = 0;
virtual void Join() = 0;
virtual void Join() = 0; // Deletes GMPThread!
};
class GMPMutex {