Bug 1660886 - Release PWebGL when ClientWebGLContext is done with it. r=handyman,jld
authorJeff Gilbert <jgilbert@mozilla.com>
Thu, 27 Aug 2020 00:50:32 +0000
changeset 546634 109f3a4de56716d3e1162c2368fe37b8a377f72f
parent 546633 35ffafc46c68d1c53616d0ec5faa1b16874b1ba4
child 546635 ef494065b8e2bc881109bcd62382a03c161d07d2
push id37735
push userabutkovits@mozilla.com
push dateThu, 27 Aug 2020 21:29:40 +0000
treeherdermozilla-central@109f3a4de567 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershandyman, jld
bugs1660886
milestone82.0a1
first release with
nightly linux32
109f3a4de567 / 82.0a1 / 20200827212940 / files
nightly linux64
109f3a4de567 / 82.0a1 / 20200827212940 / files
nightly mac
109f3a4de567 / 82.0a1 / 20200827212940 / files
nightly win32
109f3a4de567 / 82.0a1 / 20200827212940 / files
nightly win64
109f3a4de567 / 82.0a1 / 20200827212940 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1660886 - Release PWebGL when ClientWebGLContext is done with it. r=handyman,jld Differential Revision: https://phabricator.services.mozilla.com/D88067
dom/canvas/ClientWebGLContext.cpp
--- a/dom/canvas/ClientWebGLContext.cpp
+++ b/dom/canvas/ClientWebGLContext.cpp
@@ -27,17 +27,23 @@
 #include "WebGLMethodDispatcher.h"
 #include "WebGLChild.h"
 #include "WebGLValidateStrings.h"
 
 namespace mozilla {
 
 webgl::NotLostData::NotLostData(ClientWebGLContext& _context)
     : context(_context) {}
-webgl::NotLostData::~NotLostData() = default;
+
+webgl::NotLostData::~NotLostData() {
+  if (outOfProcess) {
+    const auto& pwebgl = outOfProcess->mWebGLChild;
+    Unused << WebGLChild::Send__delete__(pwebgl.get());
+  }
+}
 
 // -
 
 bool webgl::ObjectJS::ValidateForContext(
     const ClientWebGLContext& targetContext, const char* const argName) const {
   if (!IsForContext(targetContext)) {
     targetContext.EnqueueError(
         LOCAL_GL_INVALID_OPERATION,