Safe delete
This commit is contained in:
parent
ae81a8d118
commit
83b5774d1a
@ -42,6 +42,8 @@ using namespace std;
|
|||||||
#define ERR(x) std::cerr << "[error " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl; exit(-1);
|
#define ERR(x) std::cerr << "[error " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl; exit(-1);
|
||||||
#define WARN(x) std::cerr << "[warn " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl;
|
#define WARN(x) std::cerr << "[warn " << __FILE__ << ":" << __LINE__ << "] " << x << std::endl;
|
||||||
|
|
||||||
|
#define DELETE(x) { if(NULL != x) { delete x; x = NULL; } }
|
||||||
|
|
||||||
typedef unsigned int NodeID;
|
typedef unsigned int NodeID;
|
||||||
typedef unsigned int EdgeID;
|
typedef unsigned int EdgeID;
|
||||||
typedef unsigned int EdgeWeight;
|
typedef unsigned int EdgeWeight;
|
||||||
|
Loading…
Reference in New Issue
Block a user