Bug 913821 - Conservatively ensure that TextureClients/Hosts are removed at the end of a video. r=sotaro

This commit is contained in:
Nicolas Silva
2013-09-12 16:50:35 +02:00
parent fff1d4e586
commit a579e26ddb
7 changed files with 45 additions and 1 deletions

View File

@@ -111,6 +111,20 @@ GrallocTextureClientOGL::GrallocTextureClientOGL(CompositableClient* aCompositab
GrallocTextureClientOGL::~GrallocTextureClientOGL()
{
MOZ_COUNT_DTOR(GrallocTextureClientOGL);
if (ShouldDeallocateInDestructor()) {
// If the buffer has never been shared we must deallocate it or it would
// leak.
if (mBufferLocked) {
mBufferLocked->Unlock();
} else {
MOZ_ASSERT(mCompositable);
// We just need to wrap the actor in a SurfaceDescriptor because that's what
// ISurfaceAllocator uses as input, we don't care about the other parameters.
SurfaceDescriptor sd = SurfaceDescriptorGralloc(nullptr, mGrallocActor,
nsIntSize(0,0), false, false);
mCompositable->GetForwarder()->DestroySharedSurface(&sd);
}
}
}
void