Removed duplicate null checks on safe_delete.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1643 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-08-17 09:52:50 +00:00
parent e08c2cc57d
commit fc35912a52
1 changed files with 7 additions and 7 deletions

View File

@ -30,16 +30,16 @@ extern void pcsx2_aligned_free(void* pmem);
#endif #endif
////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////
// Safe deallocation macros -- always check pointer validity (non-null) when needed, // Safe deallocation macros -- checks pointer validity (non-null) when needed, and sets
// and set pointer to null after deallocation. // pointer to null after deallocation.
#define safe_delete( ptr ) \ #define safe_delete( ptr ) \
((void) (( ( ptr != NULL ) && (delete ptr, !!0) ), ptr = NULL)) ((void) (delete ptr), ptr = NULL)
#define safe_delete_array( ptr ) \ #define safe_delete_array( ptr ) \
((void) (( ( ptr != NULL ) && (delete[] ptr, !!0) ), ptr = NULL)) ((void) (delete[] ptr), ptr = NULL)
// fixme: I'm pretty sure modern libc implementations inder gcc and msvc check null status // fixme: I'm pretty sure modern libc implementations under gcc and msvc check null status
// inside free(), meaning we shouldn't have to do it ourselves. But legacy implementations // inside free(), meaning we shouldn't have to do it ourselves. But legacy implementations
// didn't always check, so best to be cautious unless absolutely certain it's being covered on // didn't always check, so best to be cautious unless absolutely certain it's being covered on
// all ported platforms. // all ported platforms.