aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-31 01:00:49 +0000
committerGravatar commit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2014-01-31 01:00:49 +0000
commitcc787fa8029889877da8edbb70a284cb0e19de33 (patch)
tree1157e87e84aeb7a870d074ddf42b2cb56067945f /include
parent6169f2b4da39099b4e593f5ff85538dfe2f0249e (diff)
fix auto-delete bug that crept in with new fast blur path; is causing
some of the valgrind errors. BUG=skia:2111 R=bsalomon@google.com, robertphillips@google.com Author: humper@google.com Review URL: https://codereview.chromium.org/148593003 git-svn-id: http://skia.googlecode.com/svn/trunk@13257 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include')
-rw-r--r--include/core/SkTemplates.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index 76254e00ee..a3a846600a 100644
--- a/include/core/SkTemplates.h
+++ b/include/core/SkTemplates.h
@@ -178,6 +178,13 @@ public:
void free() { SkDELETE_ARRAY(fArray); fArray = NULL; }
T* detach() { T* array = fArray; fArray = NULL; return array; }
+ void reset(T array[]) {
+ if (fArray != array) {
+ SkDELETE_ARRAY(fArray);
+ fArray = array;
+ }
+ }
+
private:
T* fArray;
};