mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2073 - m-c 1651587: Make image::Image release efficient on main thread
This commit is contained in:
parent
03a4a17ccf
commit
9a39001cc3
6 changed files with 75 additions and 13 deletions
|
|
@ -61,14 +61,8 @@ AnimationSurfaceProvider::DropImageReference()
|
|||
return; // Nothing to do.
|
||||
}
|
||||
|
||||
// RasterImage objects need to be destroyed on the main thread. We also need
|
||||
// to destroy them asynchronously, because if our surface cache entry is
|
||||
// destroyed and we were the only thing keeping |mImage| alive, RasterImage's
|
||||
// destructor may call into the surface cache while whatever code caused us to
|
||||
// get evicted is holding the surface cache lock, causing deadlock.
|
||||
RefPtr<RasterImage> image = mImage;
|
||||
mImage = nullptr;
|
||||
NS_ReleaseOnMainThread(image.forget(), /* aAlwaysProxy = */ true);
|
||||
// RasterImage objects need to be destroyed on the main thread.
|
||||
SurfaceCache::ReleaseImageOnMainThread(mImage.forget());
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue