aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkTLList.h
diff options
context:
space:
mode:
authorGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-05 14:51:39 +0000
committerGravatar bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-12-05 14:51:39 +0000
commit8958dc949ea9f716c46b3ca98d341f775835296d (patch)
tree44e4320c71007d0ddcffd58d48607e94d8034fd1 /src/core/SkTLList.h
parentfdabcb511d112bcbbc6ce767199cdcc49b834b90 (diff)
Add operator delete to match operator new for SkTLList.
R=robertphillips@google.com Review URL: https://codereview.appspot.com/6871061 git-svn-id: http://skia.googlecode.com/svn/trunk@6673 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core/SkTLList.h')
-rw-r--r--src/core/SkTLList.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/core/SkTLList.h b/src/core/SkTLList.h
index 01d63394d1..43554eac31 100644
--- a/src/core/SkTLList.h
+++ b/src/core/SkTLList.h
@@ -349,6 +349,17 @@ void *operator new(size_t, SkTLList<T>* list,
}
}
+// 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*,
+ SkTLList<T>*,
+ typename SkTLList<T>::Placement,
+ const typename SkTLList<T>::Iter&) {
+ SK_CRASH();
+}
+
#define SkNEW_INSERT_IN_LLIST_BEFORE(list, location, type_name, args) \
(new ((list), SkTLList< type_name >::kBefore_Placement, (location)) type_name args)