зеркало из https://github.com/mozilla/pjs.git
Bug 698205: Fix memory leak in Azure D2D backend gradients. r=jrmuizel
This commit is contained in:
Родитель
5ae078453d
Коммит
12f56f5354
|
@ -1021,7 +1021,7 @@ DrawTargetD2D::CreatePathBuilder(FillRule aFillRule) const
|
||||||
TemporaryRef<GradientStops>
|
TemporaryRef<GradientStops>
|
||||||
DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops) const
|
DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops) const
|
||||||
{
|
{
|
||||||
D2D1_GRADIENT_STOP *stops = new D2D1_GRADIENT_STOP[aNumStops];
|
vector<D2D1_GRADIENT_STOP> stops(aNumStops);
|
||||||
|
|
||||||
for (uint32_t i = 0; i < aNumStops; i++) {
|
for (uint32_t i = 0; i < aNumStops; i++) {
|
||||||
stops[i].position = rawStops[i].offset;
|
stops[i].position = rawStops[i].offset;
|
||||||
|
@ -1030,7 +1030,7 @@ DrawTargetD2D::CreateGradientStops(GradientStop *rawStops, uint32_t aNumStops) c
|
||||||
|
|
||||||
RefPtr<ID2D1GradientStopCollection> stopCollection;
|
RefPtr<ID2D1GradientStopCollection> stopCollection;
|
||||||
|
|
||||||
HRESULT hr = mRT->CreateGradientStopCollection(stops, aNumStops, byRef(stopCollection));
|
HRESULT hr = mRT->CreateGradientStopCollection(&stops.front(), aNumStops, byRef(stopCollection));
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
gfxWarning() << "Failed to create GradientStopCollection. Code: " << hr;
|
gfxWarning() << "Failed to create GradientStopCollection. Code: " << hr;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче