Bug 749678 - 5/5 - fix dangling TLS pointer - r=jrmuizel

This commit is contained in:
Benoit Jacob 2012-05-08 09:47:34 -04:00
parent b17930ac59
commit 5edd04f2ba

View File

@ -540,7 +540,13 @@ class GLContextTLSStorage
GLContext *mCurrentGLContext; GLContext *mCurrentGLContext;
NS_INLINE_DECL_REFCOUNTING(Storage) NS_INLINE_DECL_REFCOUNTING(Storage)
Storage() : mCurrentGLContext(nsnull) {} Storage() : mCurrentGLContext(nsnull) {}
~Storage() {
// avoid keeping a dangling TLS pointer to the Storage object being destroyed
tls::set<Storage>(sTLSKey, nsnull);
}
}; };
nsRefPtr<Storage> mStorage; nsRefPtr<Storage> mStorage;