diff options
author | 2012-06-04 19:58:30 +0000 | |
---|---|---|
committer | 2012-06-04 19:58:30 +0000 | |
commit | 83e5eb8d0272da6c990aae399ab9390d2090a955 (patch) | |
tree | 4eda8f5a5a5d9ca0ea0718a94064bd79bd90dcc0 /src/gpu/SkGpuDevice.cpp | |
parent | 150fee575bd1e7ce092884ce0369ff95c2f08124 (diff) |
Clean up likely reference leak in Ganesh custom stages.
http://codereview.appspot.com/6286047/
git-svn-id: http://skia.googlecode.com/svn/trunk@4146 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/gpu/SkGpuDevice.cpp')
-rw-r--r-- | src/gpu/SkGpuDevice.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gpu/SkGpuDevice.cpp b/src/gpu/SkGpuDevice.cpp index de9d9737df..056c5d8179 100644 --- a/src/gpu/SkGpuDevice.cpp +++ b/src/gpu/SkGpuDevice.cpp @@ -540,15 +540,16 @@ inline bool skPaint2GrPaintShader(SkGpuDevice* dev, GrSamplerState* sampler = grPaint->textureSampler(kShaderTextureIdx); switch (bmptype) { case SkShader::kRadial_BitmapType: { - sampler->setCustomStage(new GrRadialGradient()); + sampler->setCustomStage(new GrRadialGradient())->unref(); } break; case SkShader::kSweep_BitmapType: { - sampler->setCustomStage(new GrSweepGradient()); + sampler->setCustomStage(new GrSweepGradient())->unref(); } break; case SkShader::kTwoPointRadial_BitmapType: { - sampler->setCustomStage(new GrRadial2Gradient(twoPointParams[0], - twoPointParams[1], - twoPointParams[2] < 0)); + sampler->setCustomStage(new + GrRadial2Gradient(twoPointParams[0], + twoPointParams[1], + twoPointParams[2] < 0))->unref(); } break; default: break; |