skywinder / ActionSheetPicker-3.0

Quickly reproduce the dropdown UIPickerView / ActionSheet functionality on iOS.
http://skywinder.github.io/ActionSheetPicker-3.0
BSD 3-Clause "New" or "Revised" License
3.4k stars 740 forks source link

ActionSheetPicker crashes intermittently - EXC_BAD_ACCESS KERN_INVALID_ADDRESS 0x0000000000000200 #364

Closed Michael-753 closed 4 years ago

Michael-753 commented 7 years ago

Hello,

I don't recall this ever happening on older versions of iOS, but now on 10 my users are experiencing intermittent crashes. After investigation, it seems that when trying to build action sheet pickers, that it intermittently will cause a crash on this line:

AbstractActionSheetPicker.m: self.context = [CIContext contextWithOptions:nil];

I followed some user suggestions with similar issues related to CIContext and they all said how CIContext can be buggy with memory management and the fact it's not in Swift, and to do the following:

if( self.context == nil ) { self.context = [CIContext contextWithOptions:nil]; }

However the issue still occurs and it crashes sometimes.

Should/Can I just remove the effects this uses to avoid the crashes? Do you know what exactly is going on? Will the user experience be bad if so? Any thoughts on how to proceed? My users are reporting crashes. Thanks!

Michael-753 commented 7 years ago

I found out this happened as a result of not calling 'show' directly (i.e. instantiating the action sheet object, but not using it until I needed it).

By moving this logic all together (instantiating a new one every time) I was able to resolve the memory leak and thus my issue.

I will do more testing and then close this issue if it turns out to be true (having my users test again to make sure no one crashes)

patelgaurav4u commented 6 years ago

same issue found

skywinder commented 4 years ago

Hello. please check the latest version. Should be fixed. Feel free to reopen the issue, if you still need help. 👍