diegocarloslima / ByakuGallery

An open source Android library that allows the visualization of large images with gesture capabilities
Apache License 2.0
312 stars 93 forks source link

priority hight bug ! #11

Open chuckwu0 opened 9 years ago

chuckwu0 commented 9 years ago

priority hight bug !

the work thread is blocked by mDecodeQueue.take();
and no chance to interrupt

diegocarloslima commented 9 years ago

Hey @chuckwu0, thanks for your feedback. Under what circumstances the worker thread get blocked? Is that after some exception? Was this happening before the lasts commits? What version of Android are you using?

chuckwu0 commented 9 years ago

This situation can be easy appear when exit the image browser activity . The thread can't stop.

I think use

mDecodeQueue.poll(time, unit)

may solve the problem :)

diegocarloslima commented 9 years ago

Hey @chuckwu0 I don't see where this can be a problem. The worker thread is supposed to wait until a tile is available to decode, so that blocking is an expected behavior. Once the TileBitmapDrawable gets garbage collected, the thread is interrupted and destroyed. If I'm missing something, please let me know.

chuckwu0 commented 9 years ago

Once the TileBitmapDrawable gets garbage collected. -------- this is what i expected. but every time i start the activity which contain a viewpager show TileBitmapDrawable images . system add a thead and don't be interrupted and destroyed.
OOM happened if i start the activity a few times @diegocarloslima