Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Check if a variable has been claimed by garbage collector
- // C++ example.
- int* foo = NULL;
- foo = new int;
- delete foo;
- foo = NULL;
- if(foo) // Does this pointer actually point to something?
- #define SAFE_DELETE(ptr) if(ptr) { delete ptr; ptr = NULL; }
Add Comment
Please, Sign In to add comment