malcommac / SwiftDate

🐔 Toolkit to parse, validate, manipulate, compare and display dates, time & timezones in Swift.
MIT License
7.64k stars 768 forks source link

EXC_BAD_ACCESS #739

Closed MussaCharles closed 4 years ago

MussaCharles commented 4 years ago

I am getting EXC_BAD_ACCESS when running the app from Xcode to a device. This exception is being triggered in RelativeFormatter class when an instance of of language table is being cached on a method

private func language(forLocale locale: Locale) -> RelativeFormatterLang

Line 176:

languagesCache[localeId] = instanceOfTable // Thread 17: EXC_BAD_ACCESS (code=1, address=0x8000000000000008)

Screen Shot 2020-07-08 at 4 21 28 PM

Any thoughts on this?

alexiscn commented 4 years ago

It seems that function should be called from Main Thread. I have the same issue when using SwiftDate with AsyncDisplayKit. After change format time to main thread. the crash gone.

MussaCharles commented 4 years ago

Hi, @alexiscn Thanks for the workaround suggestion, I will try it once I get back to the project.

malcommac commented 4 years ago

I've fixed it for 6.2.0 and access is atomic right now.