mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-26 04:09:50 +00:00
Bug 1858731 - Ensure CanvasManagerChild releases its DOM worker reference on IPDL errors. r=gfx-reviewers,lsalzman
This patch ensures that we destroy CanvasManagerChild::mWorkerRef if our IPDL actor is destroyed without the DOM worker having been destroyed. This can occur when the GPU process crashes, or IPDL itself encountered an internal error. Since mWorkerRef keeps a reference to CanvasManagerChild for its shutdown callback, this means the object won't get freed until the DOM worker itself shuts down. Depends on D190830 Differential Revision: https://phabricator.services.mozilla.com/D190831
This commit is contained in:
parent
d8e189e0a0
commit
7a7a8eb1bc
@ -34,6 +34,7 @@ void CanvasManagerChild::ActorDestroy(ActorDestroyReason aReason) {
|
|||||||
if (sLocalManager.get() == this) {
|
if (sLocalManager.get() == this) {
|
||||||
sLocalManager.set(nullptr);
|
sLocalManager.set(nullptr);
|
||||||
}
|
}
|
||||||
|
mWorkerRef = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CanvasManagerChild::Destroy() {
|
void CanvasManagerChild::Destroy() {
|
||||||
@ -42,9 +43,9 @@ void CanvasManagerChild::Destroy() {
|
|||||||
mCanvasChild = nullptr;
|
mCanvasChild = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
// The caller has a strong reference. ActorDestroy will clear sLocalManager.
|
// The caller has a strong reference. ActorDestroy will clear sLocalManager
|
||||||
|
// and mWorkerRef.
|
||||||
Close();
|
Close();
|
||||||
mWorkerRef = nullptr;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* static */ void CanvasManagerChild::Shutdown() {
|
/* static */ void CanvasManagerChild::Shutdown() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user