Skip to content

Commit

Permalink
fix: if IKMemoryAwareFutureStopObserving is called before future is a…
Browse files Browse the repository at this point in the history
…ctually resolved, future ignores this call and starts obeserving
  • Loading branch information
Kentzo committed Aug 23, 2010
1 parent 4d18f19 commit 41090ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MAFuture.m
Expand Up @@ -161,7 +161,6 @@ - (id)resolveFuture
if(![self futureHasResolved])
{
[self setFutureValueUnlocked: _block()];
[self setIsObservingUnlocked:YES];
}
[_lock unlock];
return _value;
Expand All @@ -180,7 +179,9 @@ - (void)memoryWarningHandler {

#undef IKMemoryAwareFutureCreate
id IKMemoryAwareFutureCreate(id (^block)(void)) {
return [[_IKMemoryAwareFuture alloc] initWithBlock:block];
id value = [[_IKMemoryAwareFuture alloc] initWithBlock:block];
[value setIsObservingUnlocked:YES];
return value;
}

#undef IKMemoryAwareFuture
Expand Down

0 comments on commit 41090ae

Please sign in to comment.