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

Memory Leak / Issue ? SIGSEGV: SEGV_ACCERR #23

Open
Skyb0rg opened this issue Jan 3, 2019 · 3 comments
Open

Memory Leak / Issue ? SIGSEGV: SEGV_ACCERR #23

Skyb0rg opened this issue Jan 3, 2019 · 3 comments

Comments

@Skyb0rg
Copy link

Skyb0rg commented Jan 3, 2019

bildschirmfoto 2019-01-03 um 19 22 54

sometimes i get this error, maybee you can help me or improve the pod?

@Skyb0rg
Copy link
Author

Skyb0rg commented Feb 1, 2019

Hi i have a solution for this problem:

create dealloc and set delegate to nil

-(void)dealloc {
    _delegate = nil;
}

update:
-(void)characteristicDidUpdateValue

{
    @try {
        NSData* value = _characteristic.value;
        [_buffer appendData:value];
        @synchronized(self) {
            [self.delegate stream:self handleEvent:NSStreamEventHasBytesAvailable];
        }
    }
    @catch (NSException *exception) {
        NSLog(@"%@", exception.reason);
    }
}

tested about 8 hours, this error didn´t happend again, but got another error (i will report it in another Issue )

maybee we only need to update this code.

@synchronized(self) {
            [self.delegate stream:self handleEvent:NSStreamEventHasBytesAvailable];
}

do the same in -(void)characteristicDidWriteValue

-(void)characteristicDidWriteValue
{
    @try {
        @synchronized(self) {
            [self.delegate stream:self handleEvent:NSStreamEventHasSpaceAvailable];
        }
    }
    @catch (NSException *exception) {
        NSLog(@"%@", exception.reason);
    }
    
}

Hope this helps someone!!!

i will create a push-request the next days.

@Skyb0rg
Copy link
Author

Skyb0rg commented Feb 15, 2019

@synchronized(self) is not the solution.
Now i test with the serial dispatchqueue in the transporter.

@Skyb0rg
Copy link
Author

Skyb0rg commented Mar 15, 2019

created pull request for the solution. #26

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