summaryrefslogtreecommitdiff
path: root/ACE/ace/CORBA_macros.h
diff options
context:
space:
mode:
authorsma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-03 14:19:47 +0000
committersma <sma@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2007-01-03 14:19:47 +0000
commitee48f3f0066db77eb6521b49f8232167c7e588b3 (patch)
tree440c98cb217959c9654bfb2ba0d03b157d848df3 /ACE/ace/CORBA_macros.h
parent74eb5a1c246416563124ea2a4a76192b4722c717 (diff)
downloadATCD-ee48f3f0066db77eb6521b49f8232167c7e588b3.tar.gz
ChangeLogTag: Wed Jan 03 14:20:00 UTC 2007 Simon Massey <sma@prismtech.com>
Diffstat (limited to 'ACE/ace/CORBA_macros.h')
-rw-r--r--ACE/ace/CORBA_macros.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/ACE/ace/CORBA_macros.h b/ACE/ace/CORBA_macros.h
index 8b36ec2f0a0..4a7a3c44bf0 100644
--- a/ACE/ace/CORBA_macros.h
+++ b/ACE/ace/CORBA_macros.h
@@ -34,6 +34,19 @@
#include "ace/Exception_Macros.h"
+// The Windows MFC exception mechanism requires that a caught CException
+// (including the CMemoryException in use here) be freed using its Delete()
+// method. Thus, when MFC is in use and we're catching exceptions as a result
+// of new(), the exception's Delete() method has to be called. No other
+// platform imposes this sort of restriction/requirement. The Windows
+// config stuff (at least for MSVC/MFC) defines a ACE_del_bad_alloc macro
+// that works with its ACE_bad_alloc macro to implement this cleanup
+// requirement. Since no other platform requires this, define it as
+// empty here.
+#if !defined (ACE_del_bad_alloc)
+# define ACE_del_bad_alloc
+#endif
+
// If you wish to you use these macros for emulating exceptions on
// platforms which lack native exception support, you need to do the
// following:
@@ -407,7 +420,7 @@
# define ACE_NEW_THROW_EX(POINTER,CONSTRUCTOR,EXCEPTION) \
do { try { POINTER = new CONSTRUCTOR; } \
- catch (ACE_bad_alloc) { errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \
+ catch (ACE_bad_alloc) { ACE_del_bad_alloc errno = ENOMEM; ACE_THROW_INT (EXCEPTION); } \
} while (0)
#else /* ! ACE_NEW_THROWS_EXCEPTIONS */