Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5)

Unified Diff: include/core/SkTemplates.h

Issue 148593003: fix auto-delete bug that crept in with new fast blur path; is causing (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTemplates.h
diff --git a/include/core/SkTemplates.h b/include/core/SkTemplates.h
index 76254e00ee2ac710b8ad63f260ac82274db99b80..a3a846600a9e9d84f0bea176fa209b657815f258 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);
robertphillips 2014/01/31 00:23:13 Move the assignment outside of the if block?
+ fArray = array;
+ }
+ }
+
private:
T* fArray;
};
« no previous file with comments | « no previous file | src/effects/SkBlurMaskFilter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698