Bug 1609913 - Fix memory leak of native compositor surfaces. r=sotaro
authorGlenn Watson <gw@intuitionlibrary.com>
Sun, 19 Jan 2020 22:14:58 +0000
changeset 510678 bf297c03f0b7605ea3ea64320a3a4ce2b29f591f
parent 510677 72e0cabfec721441c0787c8b561231f4be551fd6
child 510679 f42dd5b1ffd6651e3ad2a2f218eb48c8a3a6825e
push id37033
push useraciure@mozilla.com
push dateMon, 20 Jan 2020 09:42:16 +0000
treeherdermozilla-central@206cec28723a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssotaro
bugs1609913
milestone74.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 1609913 - Fix memory leak of native compositor surfaces. r=sotaro Differential Revision: https://phabricator.services.mozilla.com/D60379
gfx/webrender_bindings/DCLayerTree.cpp
--- a/gfx/webrender_bindings/DCLayerTree.cpp
+++ b/gfx/webrender_bindings/DCLayerTree.cpp
@@ -236,16 +236,17 @@ void DCLayerTree::Bind(wr::NativeTileId 
 void DCLayerTree::Unbind() {
   if (mCurrentSurface.isNothing()) {
     return;
   }
 
   RefPtr<IDCompositionSurface> surface = mCurrentSurface.ref();
   surface->EndDraw();
 
+  DestroyEGLSurface();
   mCurrentSurface = Nothing();
 }
 
 void DCLayerTree::CreateSurface(wr::NativeSurfaceId aId,
                                 wr::DeviceIntSize aTileSize, bool aIsOpaque) {
   auto it = mDCSurfaces.find(aId);
   MOZ_RELEASE_ASSERT(it == mDCSurfaces.end());
   if (it != mDCSurfaces.end()) {