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

Unified Diff: include/core/SkTemplates.h

Issue 18915010: Fix leak in SkAutoSTArray (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Fixed compiler complaint r.e. ">>" vs. "> >" for templates Created 7 years, 5 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 | tests/UtilsTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/core/SkTemplates.h
===================================================================
--- include/core/SkTemplates.h (revision 10047)
+++ include/core/SkTemplates.h (working copy)
@@ -257,7 +257,8 @@
}
if (fCount != count) {
- if (count > N) {
+ if (fCount > N) {
+ // 'fArray' was allocated last time so free it now
reed1 2013/07/12 18:23:35 possibly also SkASSERT(fStorage != fArray);
robertphillips 2013/07/12 18:44:43 Done.
sk_free(fArray);
}
@@ -267,7 +268,6 @@
fArray = (T*) fStorage;
} else {
fArray = NULL;
- return;
}
fCount = count;
« no previous file with comments | « no previous file | tests/UtilsTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698