Skip to content
This repository was archived by the owner on Jun 8, 2023. It is now read-only.
This repository was archived by the owner on Jun 8, 2023. It is now read-only.

RBLHTMLView spinning the run loop #110

@alanjrogers

Description

@alanjrogers

https://github.com/github/Rebel/blob/master/Rebel/RBLHTMLView.m#L118-L120

RBLHTMLView spins the current run loop while it waits for the HTML to render.

I haven't dug into it too far yet, but I've seen this cause an intermittent crash if the HTML for the view has been assigned inside of a 'transaction' such as the begin/endUpdates calls used in view based NSTableViews.

For example:

- (NSView *)tableView:(NSTableView *)tableView viewForTableColumn:(NSTableColumn *)tableColumn row:(NSInteger)row {
    if ((NSUInteger)row >= self.cellCount) return nil;

    if (row == 0) {
       MYCellView *cellView = [[MYCellView alloc] initWithNibName:@"MYCellView" bundle:nil];
         cellView.rblHTMLView = self.htmlString;
    }
}

This method is called when rows are inserted into the table view, so usually after a call to [tableView beginUpdates]. My theory is that spinning the run loop is implicitly calling endUpdates resulting in unbalanced calls.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions