Add operator delete for SkTArray to match operator new
R=robertphillips@google.com
Review URL: https://codereview.chromium.org/17075002
git-svn-id: http://skia.googlecode.com/svn/trunk@9603 2bbb7eff-a529-9590-31e7-b0007b416f81
diff --git a/include/core/SkTArray.h b/include/core/SkTArray.h
index 13c0d71..5e66ee0 100644
--- a/include/core/SkTArray.h
+++ b/include/core/SkTArray.h
@@ -453,6 +453,13 @@
return array->push_back_raw(1);
}
+// Skia doesn't use C++ exceptions but it may be compiled with them enabled. Having an op delete
+// to match the op new silences warnings about missing op delete when a constructor throws an
+// exception.
+template <typename T> void operator delete(void*, SkTArray<T, MEM_COPY>* array, int atIndex) {
+ SK_CRASH();
+}
+
// Constructs a new object as the last element of an SkTArray.
#define SkNEW_APPEND_TO_TARRAY(array_ptr, type_name, args) \
(new ((array_ptr), (array_ptr)->count()) type_name args)