Skip to content

Commit 91afd80

Browse files
author
Mike Roberts
committed
Copy the callback block before retaining in the binding list.
1 parent 36dde67 commit 91afd80

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

objc-promise/Promise.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ - (BOOL)bindOrCallBlock:(bound_block)block
3434

3535
@synchronized (_stateLock) {
3636
if (_state == Incomplete) {
37-
[_callbackBindings addObject:block];
37+
[_callbackBindings addObject:[block copy]];
3838

3939
blockWasBound = YES;
4040
}

0 commit comments

Comments
 (0)