Bug 719429. Fix canvas data leak in DrawTargetCG. r=ajuma

I forgot to fix this before landing and refound it using
http://s3.zazub.com/games/circle_game/index.html
This commit is contained in:
Jeff Muizelaar 2012-01-19 10:33:35 -05:00
Родитель b2f7020fed
Коммит e574104a89
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -116,6 +116,7 @@ DrawTargetCG::~DrawTargetCG()
CGColorSpaceRelease(mColorSpace);
if (mCg)
CGContextRelease(mCg);
free(mData);
}
TemporaryRef<SourceSurface>
@ -845,7 +846,6 @@ DrawTargetCG::Init(const IntSize &aSize, SurfaceFormat &)
// XXX: currently we allocate ourselves so that we can easily return a gfxImageSurface
// we might not need to later if once we don't need to support gfxImageSurface
//XXX: currently Init implicitly clears, that can often be a waste of time
// XXX: leaked
mData = calloc(mSize.height * stride, 1);
// XXX: what should we do if this fails?
mCg = CGBitmapContextCreate (mData,