Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Futures free their handlers as soon as they’re completed/cancelled.

  • Loading branch information...
commit b05578af2f62b71ef1df7136a199ccaea9d3e0c8 1 parent 59e8ea1
Rob Rix authored
Showing with 12 additions and 0 deletions.
  1. +12 −0 RXFutures/RXFuture.m
12 RXFutures/RXFuture.m
View
@@ -66,6 +66,12 @@ -(void)cancel {
for(void (^block)() in cancellationHandlers) {
[self dispatchCallback:block];
}
+#if !__has_feature(objc_arc)
+ [completionHandlers release];
+ [cancellationHandlers release];
+#endif
+ completionHandlers = nil;
+ cancellationHandlers = nil;
}
}];
}
@@ -93,6 +99,12 @@ -(void)complete {
for(void (^block)() in completionHandlers) {
[self dispatchCallback:block];
}
+#if !__has_feature(objc_arc)
+ [completionHandlers release];
+ [cancellationHandlers release];
+#endif
+ completionHandlers = nil;
+ cancellationHandlers = nil;
}
}];
}
Please sign in to comment.
Something went wrong with that request. Please try again.