iotashan / TiTouchImageView

Titanium native module for TouchImageView
MIT License
70 stars 28 forks source link

added recycleBitmap() call for memory management #7

Closed jpriebe closed 9 years ago

jpriebe commented 9 years ago

I found that when I used a lot of TiTouchImageViews in an image gallery with fairly high-res images (~3MP), I would run out of memory, despite the fact that I was removing the views from my pager control once they were offscreen. When I used a regular ImageView, I didn't get the memory errors, so I was fairly certain it was TiTouchImageView that was causing the problem.

So I added a new recycleBitmap() method. When I call this before I remove each view, I don't have memory problems. I'm able to swipe through an 80-image gallery with no problems!

iotashan commented 9 years ago

Sounds good to me!