mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-12-27 10:50:35 +00:00
Bug 874367 - Release TextureUpdateRequest memory in the destructor to prevent leaks. r=nical
This commit is contained in:
parent
3f8ff3ca06
commit
69ba89c3f3
@ -450,7 +450,8 @@ ContentHostIncremental::UpdateIncremental(TextureIdentifier aTextureId,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation)
|
||||
{
|
||||
mUpdateList.AppendElement(new TextureUpdateRequest(aTextureId,
|
||||
mUpdateList.AppendElement(new TextureUpdateRequest(mDeAllocator,
|
||||
aTextureId,
|
||||
aSurface,
|
||||
aUpdated,
|
||||
aBufferRect,
|
||||
@ -642,9 +643,6 @@ ContentHostIncremental::TextureUpdateRequest::Execute(ContentHostIncremental* aH
|
||||
} else {
|
||||
aHost->mTextureHostOnWhite->Update(mDescriptor, &mUpdated, &offset);
|
||||
}
|
||||
|
||||
//TODO: Recycle these?
|
||||
aHost->mDeAllocator->DestroySharedSurface(&mDescriptor);
|
||||
}
|
||||
|
||||
#ifdef MOZ_LAYERS_HAVE_LOG
|
||||
|
@ -308,18 +308,26 @@ private:
|
||||
class TextureUpdateRequest : public Request
|
||||
{
|
||||
public:
|
||||
TextureUpdateRequest(TextureIdentifier aTextureId,
|
||||
TextureUpdateRequest(ISurfaceAllocator* aDeAllocator,
|
||||
TextureIdentifier aTextureId,
|
||||
SurfaceDescriptor& aDescriptor,
|
||||
const nsIntRegion& aUpdated,
|
||||
const nsIntRect& aBufferRect,
|
||||
const nsIntPoint& aBufferRotation)
|
||||
: mTextureId(aTextureId)
|
||||
: mDeAllocator(aDeAllocator)
|
||||
, mTextureId(aTextureId)
|
||||
, mDescriptor(aDescriptor)
|
||||
, mUpdated(aUpdated)
|
||||
, mBufferRect(aBufferRect)
|
||||
, mBufferRotation(aBufferRotation)
|
||||
{}
|
||||
|
||||
~TextureUpdateRequest()
|
||||
{
|
||||
//TODO: Recycle these?
|
||||
mDeAllocator->DestroySharedSurface(&mDescriptor);
|
||||
}
|
||||
|
||||
virtual void Execute(ContentHostIncremental *aHost);
|
||||
|
||||
private:
|
||||
@ -332,6 +340,7 @@ private:
|
||||
|
||||
nsIntRect GetQuadrantRectangle(XSide aXSide, YSide aYSide) const;
|
||||
|
||||
ISurfaceAllocator* mDeAllocator;
|
||||
TextureIdentifier mTextureId;
|
||||
SurfaceDescriptor mDescriptor;
|
||||
nsIntRegion mUpdated;
|
||||
|
Loading…
Reference in New Issue
Block a user