From 5edd04f2ba203ac180be00f559556d3ffd8515bd Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 8 May 2012 09:47:34 -0400 Subject: [PATCH] Bug 749678 - 5/5 - fix dangling TLS pointer - r=jrmuizel --- gfx/gl/GLContext.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gfx/gl/GLContext.h b/gfx/gl/GLContext.h index fcae6560b3a..f5db5102867 100644 --- a/gfx/gl/GLContext.h +++ b/gfx/gl/GLContext.h @@ -540,7 +540,13 @@ class GLContextTLSStorage GLContext *mCurrentGLContext; NS_INLINE_DECL_REFCOUNTING(Storage) + Storage() : mCurrentGLContext(nsnull) {} + + ~Storage() { + // avoid keeping a dangling TLS pointer to the Storage object being destroyed + tls::set(sTLSKey, nsnull); + } }; nsRefPtr mStorage;