Skip to content

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