Skip to content

Instantly share code, notes, and snippets.

@jspahrsummers
Created May 9, 2011 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jspahrsummers/961913 to your computer and use it in GitHub Desktop.
Save jspahrsummers/961913 to your computer and use it in GitHub Desktop.
I don't think I'll actually do this, but it was fun to come up with.
// syntactic sugar for @onExit
#define releaseOnExit \
ext_saveSelf]; @onExit { [ext_releaseObj release]; }; [(id)nil self
NSMutableString *str = [[@"foo" mutableCopy] releaseOnExit];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment