Skip to content

Commit

Permalink
-[INTERRUPT] Fixes crashing runtime call with the more robust NSInvoc…
Browse files Browse the repository at this point in the history
…ation.
  • Loading branch information
Dario Segura committed Mar 5, 2015
1 parent e9e028c commit a56c60c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ObjectAL/ObjectAL/Session/OALSuspendHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,12 @@ - (void) setInterrupted:(bool) value
{
if([localSuspendStatusChangeTarget respondsToSelector:suspendStatusChangeSelector])
{
id (*suspendStatusChange)(id, SEL, bool);
suspendStatusChange = (id (*)(id, SEL, bool))[localSuspendStatusChangeTarget methodForSelector:suspendStatusChangeSelector];
suspendStatusChange(localSuspendStatusChangeTarget, suspendStatusChangeSelector, interruptLock);
NSMethodSignature *signature = [[localSuspendStatusChangeTarget class] instanceMethodSignatureForSelector:suspendStatusChangeSelector];
NSInvocation *invocation = [NSInvocation invocationWithMethodSignature:signature];
[invocation setTarget:localSuspendStatusChangeTarget];
[invocation setSelector:suspendStatusChangeSelector];
[invocation setArgument:&interruptLock atIndex:2];
[invocation invoke];
}
}
}
Expand Down

0 comments on commit a56c60c

Please sign in to comment.