Bug 1254829 - Change global context to static RefPtr to avoid destruction during QuickExit(), r?jrmuizel draft
authorPeter Chang <pchang@mozilla.com>
Fri, 01 Apr 2016 16:23:52 +0800
changeset 346524 ba3ff3b9327253a94e1874d2fbdc31b332c3074c
parent 345720 494289c72ba3997183e7b5beaca3e0447ecaf96d
child 517470 f8bae27b6c3de3981256b0a26568dbb0cc97d932
push id14404
push userpchang@mozilla.com
push dateFri, 01 Apr 2016 08:26:13 +0000
reviewersjrmuizel
bugs1254829
milestone48.0a1
Bug 1254829 - Change global context to static RefPtr to avoid destruction during QuickExit(), r?jrmuizel MozReview-Commit-ID: COV0vvyFubo
gfx/gl/GLContextProviderWGL.cpp
--- a/gfx/gl/GLContextProviderWGL.cpp
+++ b/gfx/gl/GLContextProviderWGL.cpp
@@ -11,16 +11,17 @@
 #include "gfxPlatform.h"
 #include "gfxWindowsSurface.h"
 
 #include "gfxCrashReporterUtils.h"
 
 #include "prenv.h"
 
 #include "mozilla/Preferences.h"
+#include "mozilla/StaticPtr.h"
 
 namespace mozilla {
 namespace gl {
 
 using namespace mozilla::gfx;
 
 WGLLibrary sWGLLib;
 
@@ -682,17 +683,17 @@ GLContextProviderWGL::CreateOffscreen(co
         return nullptr;
 
     if (!gl->InitOffscreen(size, minCaps))
         return nullptr;
 
     return gl.forget();
 }
 
-static RefPtr<GLContextWGL> gGlobalContext;
+static StaticRefPtr<GLContextWGL> gGlobalContext;
 
 /*static*/ GLContext*
 GLContextProviderWGL::GetGlobalContext()
 {
     if (!sWGLLib.EnsureInitialized()) {
         return nullptr;
     }