diff --git a/gfx/layers/d3d9/TextureD3D9.cpp b/gfx/layers/d3d9/TextureD3D9.cpp index ccc5690f064b..e2c865e1760f 100644 --- a/gfx/layers/d3d9/TextureD3D9.cpp +++ b/gfx/layers/d3d9/TextureD3D9.cpp @@ -670,6 +670,9 @@ SharedTextureClientD3D9::SharedTextureClientD3D9(ISurfaceAllocator* aAllocator, SharedTextureClientD3D9::~SharedTextureClientD3D9() { MOZ_COUNT_DTOR(SharedTextureClientD3D9); + if (mTexture) { + gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4; + } } void @@ -678,9 +681,6 @@ SharedTextureClientD3D9::FinalizeOnIPDLThread() if (mTexture && mActor) { KeepUntilFullDeallocation(MakeUnique>(mTexture)); } - if (mTexture) { - gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4; - } } // static