Jtapplecalendar: reloadData unowned reference crash

Created on 15 Nov 2017  路  14Comments  路  Source: patchthecode/JTAppleCalendar

JTAppleCalendar Version: 7.1.3
Swift 4 / XCode 9.1

Crash in: UserInteractionFunctions.swift > reloadData(withAnchor:completionHandler:)
Log: Fatal error: Attempted to read an unowned reference but the object was already deallocated

screen shot 2017-11-15 at 1 29 56 pm

Steps to reproduce:

  1. Calendar is created (User navigates to calendar UI where CalendarView nib containing JTAppleCalendar is loaded into view)
  2. Calendar is destroyed (User triggers hard UI refresh, removing CalendarView nib from view and deallocating)

*Not consistently reproducible, but has been seen 3 times in the past few days
Presumably, this is occurring because the calendar is destroyed before the calendar reload completion is executed.

Already Fixed on Master Branch bug

All 14 comments

hmm. this is bad. Do you have a sample application that contains this issue?
I would really like to get my hands on that to fix immediately.
I will try to reproduce your steps.

Unfortunately I don't have a sample application. I can try to make one if you need

Yea. i'm caught up on another project. I can take a look at this at the least in another 4-5 days.
But if you provide a sample app with it, i can look at it a lot sooner.

But i already see a fix.
it should be set to weak instead of unowned.
I did not foresee your use-case. Weak, will make it nillable and thus it would not crash if its no longer available.

I will test the fix today if you provide a sample.

Okay, I will make a sample and get back to you

I can't seem to make a sample application where this is consistently reproducible. Not sure where to go from here.

@hennykat its ok, just send the sample app.
I will look through it and judge. I already suspect where it is, your sample app, will help.
You can zip it and drop it in this chat box, or send to [email protected]

Sorry, I already put it up by the time I read this. Hope this is ok: https://github.com/hennykat/CalendarSample

ok, i'll check it out over after work.

replace this in your Podfile and do a pod install

pod 'JTAppleCalendar', :git => 'https://github.com/patchthecode/JTAppleCalendar.git', :branch => 'master'

Let me know if your bug is resolved

The bug seems to be resolved! I have yet to see the crash happen again.
Will this change be in the 7.1.5 release?

yes, it will be in version 7.1.5 once i release it.
i'll leave this issue open until release. Then i will close

I ran into this bug as well. Thanks for fixing it. I am actively developing a feature right now, so relying on Master is fine. Looking forward to the 7.1.5 release!

7.1.5 released

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fatalution picture Fatalution  路  3Comments

zhanswift picture zhanswift  路  5Comments

blinkmeoff picture blinkmeoff  路  3Comments

prahaladm picture prahaladm  路  3Comments

programus picture programus  路  3Comments