Bug 1632755 - Unlink CanvasContext from the refresh driver r=aosmond

It looks like the context is registered to the refresh driver without my direct interaction, yet I'm responsible to unlink it.
Looks like a bad design to me?

Differential Revision: https://phabricator.services.mozilla.com/D72469
This commit is contained in:
Dzmitry Malyshau 2020-04-28 15:03:41 +00:00
parent ebafd74216
commit 0dc10fb897

View File

@ -32,7 +32,10 @@ CanvasContext::CanvasContext()
: mExternalImageId(layers::CompositorManagerChild::GetInstance()
->GetNextExternalImageId()) {}
CanvasContext::~CanvasContext() { Cleanup(); }
CanvasContext::~CanvasContext() {
Cleanup();
RemovePostRefreshObserver();
}
void CanvasContext::Cleanup() {
if (mSwapChain) {