Skip to content

Leaks SBOffscreenSwipeGestureRecognizer #1

@rpetrich

Description

@rpetrich

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions