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

Memory Leak on Background #26

Open
alfredolucomav opened this issue Aug 20, 2020 · 0 comments
Open

Memory Leak on Background #26

alfredolucomav opened this issue Aug 20, 2020 · 0 comments

Comments

@alfredolucomav
Copy link

alfredolucomav commented Aug 20, 2020

Hi There,

When I enter in background mode my app crashes due memory leak. I Comment the following code:

let titleView = TitleView(navigationController: nav, title: company.company_name, items: companies)
            titleView?.button.label.textColor = .white
            titleView?.button.arrow.image = titleView?.button.arrow.image?.withRenderingMode(.alwaysTemplate)
            titleView?.button.arrow.tintColor = .white
            titleView?.action = { [weak self] index in
              print("select \(index)")
                let company_name = companies[index]
                let company = user.companies.filter({ $0.company_name == company_name }).first
                self?.selectedCompany = company
                titleView?.button.label.textColor = .white
                titleView?.button.arrow.image = titleView?.button.arrow.image?.withRenderingMode(.alwaysTemplate)
                titleView?.button.arrow.tintColor = .white
                AppSessionManager.shared.retrieveProducts = false
                AppSessionManager.shared.retrieveOrders = false
                NotificationCenter.default.post(name: NSNotification.Name(rawValue: "companyChange"), object: nil)
            }
            navigationItem.titleView = titleView

Now my app does not have memory leaks. What could be happening?

Best regards

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

No branches or pull requests

1 participant