Skip to content

Crash in -[RZBPeripheral cancelAllCommands] due to infinite loop #98

@joshuatbrown

Description

@joshuatbrown

Issue

In the completion block of -[RZBPeripheral connectWithCompletion:], call -[RZBPeripheral cancelConnectionWithCompletion:]. It'll create an infinite loop and eventually crash with an EXC_BAD_ACCESS.

For example:

- (void)testCancelConnectionInConnectCompletion {
    RZBPeripheral *peripheral = [self.centralManager peripheralForUUID:self.connection.identifier];

    [peripheral connectWithCompletion:^(NSError * _Nullable error) {
        [peripheral cancelConnectionWithCompletion:nil];
    }];
    
    [self waitForQueueFlush];
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions