Skip to content
This repository has been archived by the owner on May 19, 2018. It is now read-only.

Commit

Permalink
Futures free their handlers as soon as they’re completed/cancelled.
Browse files Browse the repository at this point in the history
  • Loading branch information
robrix committed Mar 22, 2012
1 parent 59e8ea1 commit b05578a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions RXFutures/RXFuture.m
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -66,6 +66,12 @@ -(void)cancel {
for(void (^block)() in cancellationHandlers) { for(void (^block)() in cancellationHandlers) {
[self dispatchCallback:block]; [self dispatchCallback:block];
} }
#if !__has_feature(objc_arc)
[completionHandlers release];
[cancellationHandlers release];
#endif
completionHandlers = nil;
cancellationHandlers = nil;
} }
}]; }];
} }
Expand Down Expand Up @@ -93,6 +99,12 @@ -(void)complete {
for(void (^block)() in completionHandlers) { for(void (^block)() in completionHandlers) {
[self dispatchCallback:block]; [self dispatchCallback:block];
} }
#if !__has_feature(objc_arc)
[completionHandlers release];
[cancellationHandlers release];
#endif
completionHandlers = nil;
cancellationHandlers = nil;
} }
}]; }];
} }
Expand Down

0 comments on commit b05578a

Please sign in to comment.