diff --git a/YASI_12/common.h b/YASI_12/common.h index 903c7e4..4d31bef 100644 --- a/YASI_12/common.h +++ b/YASI_12/common.h @@ -24,6 +24,7 @@ namespace yasi{ #define MAKE_UNIQUE2(x,y) MAKE_UNIQUE( CONCAT(x,y) ) #define MAKE_UNIQUE3(x,y, z) MAKE_UNIQUE2( CONCAT(x,y), z ) +#define FREE_SAFE(x) {if( (x) != 0 ) free(x); (x) = 0; } #define DELETE_SAFE(x) {if( (x) != 0 ) delete (x); (x) = 0; } #define FREE_SAFE(x) {if( (x) != 0 ) free(x); (x) = 0; } #define DELETE_ARR_SAFE(x) {if( (x) != 0 ) delete[] (x); (x) = 0; }