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

Unified Diff: include/private/SkOncePtr.h

Issue 1311893010: Specialize SkOncePtr<T[]>. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 3 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 | « include/core/SkColorTable.h ('k') | src/core/SkColorTable.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/private/SkOncePtr.h
diff --git a/include/private/SkOncePtr.h b/include/private/SkOncePtr.h
index 40bea1a4c3b9cf462d69077748134d93d15ab3a3..ee30d8f8db78b69162f3ec564359778a6b4e1ff4 100644
--- a/include/private/SkOncePtr.h
+++ b/include/private/SkOncePtr.h
@@ -40,6 +40,10 @@ private:
SkBaseOncePtr<T> fOnce;
};
+// If you ask for SkOncePtr<T[]>, we'll clean up with delete[] by default.
+template <typename T>
+class SkOncePtr<T[]> : public SkOncePtr<T, skstd::default_delete<T[]>> {};
+
/* TODO(mtklein): in next CL
typedef SkBaseOncePtr<void> SkOnceFlag;
#define SK_DECLARE_STATIC_ONCE(name) namespace {} static SkOnceFlag name
« no previous file with comments | « include/core/SkColorTable.h ('k') | src/core/SkColorTable.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698