colinta / teacup

This project has been sunset in favor of MotionKit
github.com/motion-kit/motion-kit
Other
602 stars 85 forks source link

Views not released in Teacup #125

Closed ghost closed 10 years ago

ghost commented 11 years ago

It seems that when a ViewController containing a Teacup view is released, the Teacup-created views are still retained and leaked.

See my sample app illustrating this problem here: https://github.com/paulcarpenterSE/RubymotionLeaks

Things become even clearer in the sample app when you sublclass the UILabels like so:

class RMLabel < UILabel
  def dealloc
    puts "dealloc!"
    super
  end
end

With the subclass, the non-Teacup RMLabel displays a dealloc message when appropriate, and the Teacup-generated RMLabel displays no message.

See a related Teacup issue here: https://github.com/rubymotion/teacup/issues/88

See the original conversation here: https://groups.google.com/forum/#!topic/rubymotion/xk9T2DxTrQs

jdewind commented 11 years ago

This is kind of a big deal. I've been able to verify this as well.

I'll look into what might be causing it.

ghost commented 10 years ago

I should note that this appears to have been resolved. There was a memory leak in the cache that Colin fixed a while ago (2.1.2 I think?) once we actually dove down into detail. See this topic for more information: https://groups.google.com/forum/#!searchin/rubymotion/memory$20leak/rubymotion/xk9T2DxTrQs/Osdaxr5aFZYJ