herzbube / littlego

Little Go. An iOS application that lets you play the game of Go on the iPhone or iPad.
https://littlego.herzbube.ch/
Apache License 2.0
138 stars 54 forks source link

Avoid crash due to deallocated BoardPositionButtonBoxDataSource when interface orientation changes #406

Closed herzbube closed 1 year ago

herzbube commented 1 year ago

Seen on simulator for iOS 12.4 and device iPhone 6s Plus: traitCollectionDidChange:() is invoked on ButtonBoxController during interface rotation (from Portrait to Landscape), causing it to reload data and access its data source. This happens after the data source is already deallocated, resulting in a crash.

On later iOS versions (e.g. 15.2) the behaviour cannot be observed, i.e. traitCollectionDidChange:() is not invoked.