Skip to content
This repository has been archived by the owner on Sep 21, 2020. It is now read-only.

Retain Cycle in CarbonTabSwipeNavigation #9

Closed
troystump opened this issue Apr 22, 2015 · 0 comments
Closed

Retain Cycle in CarbonTabSwipeNavigation #9

troystump opened this issue Apr 22, 2015 · 0 comments

Comments

@troystump
Copy link

Hi there,

It seems there is a retain cycle on line 61 of CarbonTabSwipeNavigation.m:

rootViewController = viewController;

Since rootViewController is an instance variable, which is strong by default, the child view controller is retaining the parent view controller.

An easy fix is to make the rootViewController instance variable weak on line 38:

__weak UIViewController *rootViewController;

This then allows the parent to dealloc correctly (e.g. when the root view controller is popped off the navigation stack).

Thanks a lot, and great library so far!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants