Bug 1779766 - Ensure DrawTargetWebgl is done using shmem before dealloc. r=aosmond,gfx-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D151957
This commit is contained in:
Lee Salzman 2022-07-15 20:34:19 +00:00
parent 3eea487471
commit db788f9953

View File

@ -219,6 +219,8 @@ DrawTargetWebgl::~DrawTargetWebgl() {
if (mShmem.IsWritable()) {
// Force any Skia snapshots to copy the shmem before it deallocs.
mSkia->DetachAllSnapshots();
// Ensure we're done using the shmem before dealloc.
mSharedContext->WaitForShmem();
auto* child = mSharedContext->mWebgl->GetChild();
if (child && child->CanSend()) {
child->DeallocShmem(mShmem);