Created
December 4, 2014 18:07
-
-
Save danieleggert/c14d4c1856e2a3ff6ceb to your computer and use it in GitHub Desktop.
Revisions
-
danieleggert created this gist
Dec 4, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ @implementation Foo { BOOL _needsTearDown; } - (instancetype)init; { self = [super init]; if (self) { _needsTearDown = YES; // initialization here } return self; } - (void)tearDown; { if (_needsTearDown) { // tear down back pointers and async code here. _needsTearDown = NO; } } - (void)dealloc { if (_needsTearDown) { __builtin_trap(); } } @end