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 Navigation Dismantle Crash When Unmounting Navigation Screen #64

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Victor-Andrade
Copy link

This PR fixes an EXC_BAD_ACCESS crash occurring when unmounting a screen that uses our custom navigation library.

Error Explanation:
The crash was triggered in the dismantleUIViewController method. The issue stemmed from two points:

  • An unnecessary try was used on a non-throwing assignment to navigation.viewControllers.
  • A forced cast (as! PopAwareUINavigationController) was used, which could lead to memory access issues if the object was not of the expected type.

Solution:

  • Removed the redundant try.
  • Replaced the forced cast with a conditional cast (as? PopAwareUINavigationController).
  • Ensured that UI updates occur on the main thread.

These changes prevent invalid memory access and improve the stability.

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.

1 participant