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

EXC_BAD_ACCESS causing crash on iOS #20

Open
Justin-Credible opened this issue Jul 10, 2015 · 1 comment
Open

EXC_BAD_ACCESS causing crash on iOS #20

Justin-Credible opened this issue Jul 10, 2015 · 1 comment

Comments

@Justin-Credible
Copy link

Sometimes when calling hide() after a indicator has already been hidden an EXC_BAD_ACCESS can occur.

It occurs on line 402 on the first if block check of the hide method:

- (void)hide:(CDVInvokedUrlCommand*)command
{
    if (!self.progressIndicator) {
        CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_ERROR];
        [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
        return;
    }
    [self.progressIndicator hide:YES];
    CDVPluginResult* pluginResult = [CDVPluginResult resultWithStatus:CDVCommandStatus_OK messageAsString:@""];
    [self.commandDelegate sendPluginResult:pluginResult callbackId:command.callbackId];
}

It would be nice if multiple calls to hide() didn't cause a crash.

@Justin-Credible
Copy link
Author

I was able to fix this by nilling out the progressIndicator instance variable in the hide method. This prevents the bad access exception for future calls to the hide method.

I've submitted pull request #21 with this change.

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