From 9b1863f4b243d1511a57c05d128a4b548e795bdf Mon Sep 17 00:00:00 2001 From: DrZiplok Date: Tue, 28 Dec 2010 23:29:46 +0000 Subject: [PATCH] operator new[] should return a zeroed class object just like operator new does. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1337 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- libraries/AP_Common/c++.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libraries/AP_Common/c++.cpp b/libraries/AP_Common/c++.cpp index 7deac1a28a..307287694a 100644 --- a/libraries/AP_Common/c++.cpp +++ b/libraries/AP_Common/c++.cpp @@ -21,9 +21,14 @@ void operator delete(void *p) if (p) free(p); } +extern "C" void __cxa_pure_virtual() +{ + while (1); +} + void * operator new[](size_t size) { - return malloc(size); + return(calloc(size, 1)); } void operator delete[](void * ptr)