Bug 758531: Prevent leaking Azure Patterns' GradientStops. r=roc

This commit is contained in:
Bas Schouten 2012-05-30 06:42:41 +02:00
Родитель ac8629b453
Коммит d2bb6613fd
1 изменённых файлов: 6 добавлений и 1 удалений

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

@ -1,4 +1,4 @@
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
/* -*- Mode: C++; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 2 -*-
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@ -122,6 +122,11 @@ gfxPattern::GetMatrix() const
Pattern*
gfxPattern::GetPattern(DrawTarget *aTarget, Matrix *aPatternTransform)
{
if (mGfxPattern) {
mGfxPattern->~Pattern();
mGfxPattern = nsnull;
}
if (!mPattern) {
mGfxPattern = new (mSurfacePattern.addr())
SurfacePattern(mSourceSurface, EXTEND_CLAMP, mTransform);