Zephyr
Zephyr copied to clipboard
Leaks SBOffscreenSwipeGestureRecognizer
Every time a touch begins, two new SBOffscreenSwipeGestureRecognizer are allocated. I used this code to make SBGestureRecognizer.activeRecognizers work in cycript:
static CFMutableSetRef activeRecognizers;
%hook SBGestureRecognizer
%new
+ (NSSet *)activeRecognizers
{
return (NSSet *)activeRecognizers;
}
- (id)init
{
if ((self = %orig)) {
if (!activeRecognizers)
activeRecognizers = CFSetCreateMutable(NULL, 0, NULL);
CFSetAddValue(activeRecognizers, self);
}
return self;
}
- (void)dealloc
{
CFSetRemoveValue(activeRecognizers, self);
%orig;
}
%end