alexhillc / AXPhotoViewer

An iOS/tvOS photo gallery viewer, useful for viewing a large (or small!) number of photos.
https://www.cocoacontrols.com/controls/axphotoviewer
MIT License
646 stars 119 forks source link

loses count on swipe and then crashes #12

Closed goodbox closed 6 years ago

goodbox commented 6 years ago

Its not working for me. It loses count on swipe and then crashes. For example, when i swipe to the final photo, and then try and swipe for one more, the count goes down and it loses track of the count, and then, ultimately, swiping through more of the photos, it crashes.

alexhillc commented 6 years ago

Hi @goodbox, thanks for the report. Can you provide a stack trace for the crash you are experiencing? I haven't been able to reproduce this kind of behavior in the example app.

alexhillc commented 6 years ago

Do you use NewRelic? @goodbox

goodbox commented 6 years ago

no, never heard of it.

On Wed, Sep 6, 2017 at 2:29 PM, Alex Hill notifications@github.com wrote:

Do you use NewRelic?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/alexhillc/AXPhotoViewer/issues/12#issuecomment-327603796, or mute the thread https://github.com/notifications/unsubscribe-auth/ABH1bKj1TJMGKJ4Dj1407hZHTKM-rLxjks5sfwChgaJpZM4PDR8b .

goodbox commented 6 years ago

Here is the output from the debug window.

2017-09-06 20:30:05.198538-0600 App[5255:1796541] Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x10fb06640 of class AXPhotoViewController was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x17482cb20> ( <NSKeyValueObservance 0x174640f30: Observer: 0x103bb1540, Key path: parent, Options: <New: YES, Old: NO, Prior: NO> Context: 0x1011d7858, Property: 0x174458300> )' First throw call stack: (0x18fdcafe0 0x18e82c538 0x18fdcaf28 0x190827160 0x1967eaf88 0x1967eb1b4 0x1967ee818 0x1967ea3d8 0x195ef9cc0 0x1930ea274 0x1930dede8 0x1930deca8 0x19305a34c 0x1930813ac 0x192fdd530 0x190037b9c 0x18fd61960 0x18fd79ae4 0x18fd79284 0x18fd76d98 0x18fca6da4 0x191711074 0x195f61c9c 0x1001555e4 0x18ecb559c) libc++abi.dylib: terminating with uncaught exception of type NSException

Not exactly an iOS guru yet so not sure about how to get a stacktrace but is this what you're looking for?

screen shot 2017-09-06 at 8 39 12 pm
alexhillc commented 6 years ago

I've committed an attempt at fixing this issue, should be fixed in the latest release.