ajayk0719 / jai-tools

Automatically exported from code.google.com/p/jai-tools
0 stars 0 forks source link

DiskMemTileCache: detect when owning image has been garbage collected #20

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
From discussion with Robert Below...

The check for tiles with null owner is a good addition, but at later on I'd 
like to supplement it with a 
reference handling method in the tile class itself: ie. when an image is 
garbage collected while its 
tiles are still cached, the tiles register that the weak reference for owner 
has been enqueued and 
notify the cache to deal with this. 

Original issue reported on code.google.com by michael.bedward@gmail.com on 17 Dec 2009 at 1:45

GoogleCodeExporter commented 9 years ago
Since the removeNullTiles method was already there, I've implemented this as 
follows...

- Added a single-thread scheduled executor to the cache to call removeNullTiles 
at a fixed interval.

- Made removeNullTiles a private method.

- Added getter and setter methods for the tile polling interval.

Committed to trunk r1513

Original comment by michael.bedward@gmail.com on 7 Mar 2011 at 7:59