daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Jan 12th, 2019 47 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Check if a variable has been claimed by garbage collector
  2. // C++ example.
  3. int* foo = NULL;
  4. foo = new int;
  5. delete foo;
  6. foo = NULL;
  7.    
  8. if(foo) // Does this pointer actually point to something?
  9.    
  10. #define SAFE_DELETE(ptr) if(ptr) { delete ptr; ptr = NULL; }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top