Skip to content

Memory problem after deallocating label's parent view. #44

Description

@sfwalsh

We have a View that uses the CountdownLabel.
When the view is deallocated, the countdownlabel remains in memory.
screenshot 2019-01-25 at 15 01 37

The issue seems to be related to the LTMorphingLabel used inside the library:
screenshot 2019-01-23 at 20 55 33

I'm still able to see the issue after removing calls to the start timer function and setting the label to optional and manually nilling upon deinit.

Here's an example:

import CountdownLabel

final class SomeView: UIView {
  private var countdownLabel = CountdownLabel?
  
  init() {
    // setup label
    ...
  }

  func setupSubviews() {
    // setup constraints
  }

  deinit {
    self.countdownLabel?.cancel()
    self.countdownLabel?.removeFromSuperview()
    self.countdownLabel = nil
  }
}

Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions