Bug 961405 - Change GraphicBufferLocked as to use AtomicRefCountedWithFinalize. r=nical, r=pchang, r=doublec, r=mikeh

This commit is contained in:
Sotaro Ikeda
2014-01-21 13:53:48 -05:00
parent 4b475928b0
commit aa705dd60b
9 changed files with 45 additions and 27 deletions

View File

@@ -35,7 +35,6 @@ public:
virtual void DeallocateSharedData(ISurfaceAllocator*) MOZ_OVERRIDE
{
mBufferLocked->Unlock();
mBufferLocked = nullptr;
}
@@ -129,9 +128,7 @@ GrallocTextureClientOGL::~GrallocTextureClientOGL()
if (ShouldDeallocateInDestructor()) {
// If the buffer has never been shared we must deallocate it or it would
// leak.
if (mBufferLocked) {
mBufferLocked->Unlock();
} else {
if (!mBufferLocked) {
// 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,