mirror of
https://github.com/keymanapp/keyman.git
synced 2026-09-15 20:17:43 +00:00
[Mac] Added comment to explain ugly code.
This commit is contained in:
parent
12521fb7d2
commit
976d626671
1 changed files with 6 additions and 0 deletions
|
|
@ -232,6 +232,12 @@ const NSTimeInterval repeatInterval = 0.05f;
|
|||
}
|
||||
|
||||
-(void)processKeyClick {
|
||||
// This code was previously incorrectly implemented because the function call failed to pass "self" as the
|
||||
// final parameter. This page describes the fix, as implemented here:
|
||||
// https://stackoverflow.com/questions/27626617/how-to-solve-performselector-may-cause-leak-because-its-selector-is-unknown?noredirect=1&lq=1
|
||||
// This is almost certainly not the *best* way to implement this, but we're up against our release deadline,
|
||||
// so it should be revisted soon to come up with a more readable and reliable approach, and maybe even a
|
||||
// unit-testable one.
|
||||
SEL selector = self.action;
|
||||
IMP imp = [self.target methodForSelector:selector];
|
||||
void (*func)(id, SEL, id) = (void *)imp;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue