[commit] r1689 - trunk/GME/Common

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Tue Nov 15 17:20:15 CST 2011


Author: ksmyth
Date: Tue Nov 15 17:20:15 2011
New Revision: 1689

Log:
Catch more OOM exceptions

Modified:
   trunk/GME/Common/CommonError.h

Modified: trunk/GME/Common/CommonError.h
==============================================================================
--- trunk/GME/Common/CommonError.h	Tue Nov 15 17:20:04 2011	(r1688)
+++ trunk/GME/Common/CommonError.h	Tue Nov 15 17:20:15 2011	(r1689)
@@ -76,6 +76,19 @@
 			SetStandardOrGMEErrorInfo(e.Error()); \
 		return e.Error(); \
 	} \
+	catch (const std::bad_alloc& ) \
+	{ \
+		try { CLEANUP; } catch (const std::bad_alloc& ) { } \
+		SetStandardOrGMEErrorInfo(E_OUTOFMEMORY); \
+		return E_OUTOFMEMORY; \
+	} \
+	catch (CMemoryException* e) \
+	{ \
+		try { CLEANUP; } catch (const std::bad_alloc& ) { } \
+		e->Delete(); \
+		SetStandardOrGMEErrorInfo(E_OUTOFMEMORY); \
+		return E_OUTOFMEMORY; \
+	} \
 	return S_OK;
 
 #define COMRETURN(HR) \


More information about the gme-commit mailing list