-1

This is related to memory leak issues. I have a view controller which displays by calling performSegueWithIdentifier, and closes by calling self.dismissViewController. I have a deinit function inside of this view controller, but it does not get called when the dismissViewController is called, it only gets called when the view controller is displayed. Can someone explain why I'm seeing this unusual behavior? Thank you!

jackson
  • 81
  • 1
  • 9
  • You should add some code here, so that no one start guessing, but advise you on the issues with your code. ;) – Oleg Danu May 10 '16 at 11:13
  • The related code isn't much to post, the view controller opens by calling performSegueWithIdentifier, and closes by calling self.dismissViewController. – jackson May 10 '16 at 11:38
  • If it's not much to post, then it's not much for you to debug yourself. – gnasher729 May 10 '16 at 13:06

1 Answers1

1

Probably you have a strong reference of your second controller in your presenting controller. So when you dismiss, deinit does not get called. If you present again the previous instance gets deinited.

stefos
  • 1,235
  • 1
  • 10
  • 18