Bug 1359295 - Call MakeCurrent() before destroying webrender renderer r=nical
authorSotaro Ikeda <sotaro.ikeda.g@gmail.com>
Tue, 25 Apr 2017 08:39:33 -0700
changeset 355179 708b9a30040654c6ead5d03a18966d11181cee1d
parent 355178 0fd98cd60c05480d81c3f7d48d017535b8bbd1c0
child 355180 524eeea1b28b8fc48a87868d67c8d3718050f624
push id31723
push userkwierso@gmail.com
push dateThu, 27 Apr 2017 18:22:49 +0000
treeherdermozilla-central@c5c2b95e9d7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnical
bugs1359295
milestone55.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1359295 - Call MakeCurrent() before destroying webrender renderer r=nical
gfx/webrender_bindings/RendererOGL.cpp
--- a/gfx/webrender_bindings/RendererOGL.cpp
+++ b/gfx/webrender_bindings/RendererOGL.cpp
@@ -69,16 +69,21 @@ RendererOGL::RendererOGL(RefPtr<RenderTh
   MOZ_ASSERT(mWrRenderer);
   MOZ_ASSERT(mBridge);
   MOZ_COUNT_CTOR(RendererOGL);
 }
 
 RendererOGL::~RendererOGL()
 {
   MOZ_COUNT_DTOR(RendererOGL);
+  if (!mGL->MakeCurrent()) {
+    gfxCriticalNote << "Failed to make render context current during destroying.";
+    // Leak resources!
+    return;
+  }
   wr_renderer_delete(mWrRenderer);
 }
 
 WrExternalImageHandler
 RendererOGL::GetExternalImageHandler()
 {
   return WrExternalImageHandler {
     this,