Bug 1366502 - Make sure the RenderTextureHost is released in render thread. r=sotaro.
authorJerryShih <hshih@mozilla.com>
Wed, 07 Jun 2017 23:44:05 +0800
changeset 413196 636b348d5129b7e077072528ddfd20e3923d17b1
parent 413195 45279b23564d91829462eadb54d8547ae67aff73
child 413197 68f1d270a475df5df32c19119af1911b48e641c0
push id1490
push usermtabara@mozilla.com
push dateMon, 31 Jul 2017 14:08:16 +0000
treeherdermozilla-release@70e32e6bf15e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1366502
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 1366502 - Make sure the RenderTextureHost is released in render thread. r=sotaro. The RenderTextureHost might calls some thread-specific functions(e.g. OpenGL calls) in ~RenderTextureHost(). Add a checking here to prevent this problem. MozReview-Commit-ID: 62QlavmXOig
gfx/webrender_bindings/RenderTextureHost.cpp
--- a/gfx/webrender_bindings/RenderTextureHost.cpp
+++ b/gfx/webrender_bindings/RenderTextureHost.cpp
@@ -1,22 +1,24 @@
 /* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RenderTextureHost.h"
+#include "RenderThread.h"
 
 namespace mozilla {
 namespace wr {
 
 RenderTextureHost::RenderTextureHost()
 {
   MOZ_COUNT_CTOR(RenderTextureHost);
 }
 
 RenderTextureHost::~RenderTextureHost()
 {
+  MOZ_ASSERT(RenderThread::IsInRenderThread());
   MOZ_COUNT_DTOR(RenderTextureHost);
 }
 
 } // namespace wr
 } // namespace mozilla