mirror of https://github.com/PCSX2/pcsx2.git
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:
parent
e08c2cc57d
commit
fc35912a52
|
@ -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.
|
||||||
|
|
Loading…
Reference in New Issue