Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In simulator, create new event bus will throw an exception #8

Open
angeloh opened this issue Aug 6, 2014 · 0 comments
Open

In simulator, create new event bus will throw an exception #8

angeloh opened this issue Aug 6, 2014 · 0 comments

Comments

@angeloh
Copy link

angeloh commented Aug 6, 2014

To reproduce, turning off the internet and creating a event bus on iOS simulator. It will throw this following exception. I did check network connection with reachability but it won't work for simulator because simulator will NOT get correct network status from it.

The best way to fix this bug, it is to throw GDC_BUS_ON_ERROR message when the connection to the server fails.

*** -[ComGoodowRealtimeObjcObjCWebSocket retain]: message sent to deallocated instance 0x10f180af0

It would fail at the following line because self.delegate has already been deallocated.

- (void)_failWithError:(NSError *)error;
{
    dispatch_async(_workQueue, ^{
        if (self.readyState != SR_CLOSED) {
            _failed = YES;
            [self _performDelegateBlock:^{
               "failed at this line" => if ([self.delegate respondsToSelector:@selector(webSocket:didFailWithError:)]) {
                    [self.delegate webSocket:self didFailWithError:error];
                }
            }];

            self.readyState = SR_CLOSED;
            _selfRetain = nil;

            SRFastLog(@"Failing with error %@", error.localizedDescription);

            [self _disconnect];
        }
    });
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant