{"action":"created","issue":{"url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/23","repository_url":"https://api.github.com/repos/eggswift/ESTabBarController","labels_url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/23/comments","events_url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/23/events","html_url":"https://github.com/eggswift/ESTabBarController/issues/23","id":211639807,"number":23,"title":"Retain cycle exists somewhere","user":{"login":"benyboariu","id":958322,"avatar_url":"https://avatars2.githubusercontent.com/u/958322?v=3","gravatar_id":"","url":"https://api.github.com/users/benyboariu","html_url":"https://github.com/benyboariu","followers_url":"https://api.github.com/users/benyboariu/followers","following_url":"https://api.github.com/users/benyboariu/following{/other_user}","gists_url":"https://api.github.com/users/benyboariu/gists{/gist_id}","starred_url":"https://api.github.com/users/benyboariu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benyboariu/subscriptions","organizations_url":"https://api.github.com/users/benyboariu/orgs","repos_url":"https://api.github.com/users/benyboariu/repos","events_url":"https://api.github.com/users/benyboariu/events{/privacy}","received_events_url":"https://api.github.com/users/benyboariu/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-03-03T09:42:27Z","updated_at":"2017-03-03T10:46:09Z","closed_at":"2017-03-03T10:46:09Z","body":"In your example project, I went to **ExampleViewController.swift** and added this code:\r\n`deinit {\r\n        print(\"Did deinit\")\r\n    }`\r\n\r\nThen if you run the app and open **1.1 UITabBarController style**, then **Click to pop or dismiss**, you'll see in debugger that all 5 instances of **ExampleViewController** get deinit.\r\n\r\nNow go to **1.2 ESTabBarController like system style**, and do the same, and when you dismiss, none of the 5 instance gets deallocated. \r\n\r\nThis means somewhere is a retain cycle. I found at least one, which I fixed, but still not enough, there should be some more:\r\nhttps://github.com/eggswift/ESTabBarController/blob/master/Sources/ESTabBar.swift#L347\r\n\r\nNot sure about this one ...??\r\nhttps://github.com/eggswift/ESTabBarController/blob/master/Sources/ESTabBar.swift#L343\r\n\r\nI managed to partially fix this in my project by calling this code when logging out of the app:\r\n`esTabBarController.viewControllers                        = nil`\r\nThis will force deinit 4 of the 5 instances of view controllers from the esTabBarController, but always last one doesn't get deinit. \r\nIf you can help would be very good, because it's causing memory leak.\r\n"},"comment":{"url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/comments/283923395","html_url":"https://github.com/eggswift/ESTabBarController/issues/23#issuecomment-283923395","issue_url":"https://api.github.com/repos/eggswift/ESTabBarController/issues/23","id":283923395,"user":{"login":"benyboariu","id":958322,"avatar_url":"https://avatars2.githubusercontent.com/u/958322?v=3","gravatar_id":"","url":"https://api.github.com/users/benyboariu","html_url":"https://github.com/benyboariu","followers_url":"https://api.github.com/users/benyboariu/followers","following_url":"https://api.github.com/users/benyboariu/following{/other_user}","gists_url":"https://api.github.com/users/benyboariu/gists{/gist_id}","starred_url":"https://api.github.com/users/benyboariu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benyboariu/subscriptions","organizations_url":"https://api.github.com/users/benyboariu/orgs","repos_url":"https://api.github.com/users/benyboariu/repos","events_url":"https://api.github.com/users/benyboariu/events{/privacy}","received_events_url":"https://api.github.com/users/benyboariu/received_events","type":"User","site_admin":false},"created_at":"2017-03-03T10:46:09Z","updated_at":"2017-03-03T10:46:09Z","body":"Fixed, thank you."}}
{"actor":{"display_login":"benyboariu"}}