Bug 623451: Don't double-release surfaces. r=jrmuizel a=b

This commit is contained in:
Chris Jones 2011-01-11 15:34:31 -06:00
parent 24f6509560
commit cd11268459
2 changed files with 10 additions and 0 deletions

View File

@ -415,6 +415,10 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
nsRefPtr<gfxSharedImageSurface> newFront =
gfxSharedImageSurface::Open(op.newFrontBuffer());
nsRefPtr<gfxSharedImageSurface> newBack = canvas->Swap(newFront);
if (newFront == newBack) {
newFront.forget();
}
canvas->Updated(op.updated());
replyv.push_back(OpBufferSwap(shadow, NULL,
@ -433,6 +437,9 @@ ShadowLayersParent::RecvUpdate(const InfallibleTArray<Edit>& cset,
nsRefPtr<gfxSharedImageSurface> newFront =
gfxSharedImageSurface::Open(op.newFrontBuffer());
nsRefPtr<gfxSharedImageSurface> newBack = image->Swap(newFront);
if (newFront == newBack) {
newFront.forget();
}
replyv.push_back(OpBufferSwap(shadow, NULL,
newBack->GetShmem()));

View File

@ -61,6 +61,7 @@ GetShmInfoPtr(const Shmem& aShmem)
gfxSharedImageSurface::~gfxSharedImageSurface()
{
MOZ_COUNT_DTOR(gfxSharedImageSurface);
}
/*static*/ PRBool
@ -75,6 +76,8 @@ gfxSharedImageSurface::gfxSharedImageSurface(const gfxIntSize& aSize,
gfxImageFormat aFormat,
const Shmem& aShmem)
{
MOZ_COUNT_CTOR(gfxSharedImageSurface);
mSize = aSize;
mFormat = aFormat;
mStride = ComputeStride(aSize, aFormat);