Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #FB7543829 Apple Radar about a crash on termination #648

Merged
merged 1 commit into from
Mar 20, 2020

Conversation

dive
Copy link
Member

@dive dive commented Mar 19, 2020

Hello there,

This is a fix for the problem (FB7543829) with crashes when the user terminates an application when a keyboard has a highlighted suggestion in the accessory view.

The idea behind the fix was taken from this discussion. In general, we set up an observer in the willMove(toSuperview:) function but the documentation says explicitly that the function "Tells the view that its superview is about to change to the specified superview". Pay attention to the "is about to change" phrase. So, it is not guaranteed here that the superview will persist.

So, to fix the problem I moved the setup of the observer to the didMoveToSuperview() and it seems that the change has fixed the problem. After testing it manually, I did not find any problems and the change seems safe and harmless to me.

What do you think?

@wiruzx wiruzx self-requested a review March 20, 2020 14:37
@MikhailGasanov MikhailGasanov merged commit d74745b into master Mar 20, 2020
@wiruzx wiruzx deleted the FB7543829_fix branch March 20, 2020 15:00
antipex pushed a commit to perrystreetsoftware/Chatto that referenced this pull request Apr 20, 2020
Fix for #FB7543829 Apple Radar about a crash on termination
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants