summaryrefslogtreecommitdiff
path: root/ACE/ace/config-win32-msvc.h
diff options
context:
space:
mode:
authorSteve Huston <shuston@riverace.com>2006-11-22 22:02:38 +0000
committerSteve Huston <shuston@riverace.com>2006-11-22 22:02:38 +0000
commit011181470ce99a9c6522f4ae343e3ffee7503186 (patch)
tree727adde8442af1a0c0c270a537e026fc0caffdd9 /ACE/ace/config-win32-msvc.h
parenteaecbaca808c1f046c7d87e66564cffc3809f133 (diff)
downloadATCD-011181470ce99a9c6522f4ae343e3ffee7503186.tar.gz
ChangeLogTag:Wed Nov 22 21:58:16 UTC 2006 Steve Huston <shuston@riverace.com>
Diffstat (limited to 'ACE/ace/config-win32-msvc.h')
-rw-r--r--ACE/ace/config-win32-msvc.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/ACE/ace/config-win32-msvc.h b/ACE/ace/config-win32-msvc.h
index 9b85888b05b..b6758dfa96f 100644
--- a/ACE/ace/config-win32-msvc.h
+++ b/ACE/ace/config-win32-msvc.h
@@ -65,12 +65,22 @@
# error This version of Microsoft Visual C++ is not supported.
#endif
-// MFC changes the behavior of operator new at all MSVC versions from 6 up,
-// see ace/OS_Memory.h (throws a static CMemoryException* instead of std::bad_alloc)
+// MFC changes the behavior of operator new at all MSVC versions from 6 up
+// by throwing a static CMemoryException* instead of std::bad_alloc
+// (see ace/OS_Memory.h). This MFC exception object needs to be cleaned up
+// by calling its Delete() method.
#if defined (ACE_HAS_MFC) && (ACE_HAS_MFC == 1)
# if !defined (ACE_NEW_THROWS_EXCEPTIONS)
# define ACE_NEW_THROWS_EXCEPTIONS
# endif
+# if defined (ACE_bad_alloc)
+# undef ACE_bad_alloc
+# endif
+# define ACE_bad_alloc CMemoryException *e
+# if defined (ACE_del_bad_alloc)
+# undef ACE_del_bad_alloc
+# endif
+# define ACE_del_bad_alloc e->Delete();
#endif /* ACE_HAS_MFC && ACE_HAS_MFC==1 */
#if defined(ACE_MT_SAFE) && (ACE_MT_SAFE != 0)