Rabbit Escape  2017-01-14_18:33:47_+0000__(tag:_v0.10.1)
Static Public Member Functions | Private Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
rabbitescape.ui.android.SingletonBitmapCache Class Reference
Collaboration diagram for rabbitescape.ui.android.SingletonBitmapCache:
Collaboration graph
[legend]

Static Public Member Functions

static synchronized BitmapCache< AndroidBitmapinstance (Resources resources)
 

Private Member Functions

 SingletonBitmapCache ()
 

Static Private Member Functions

static long cacheSize ()
 

Static Private Attributes

static BitmapCache< AndroidBitmaptheInstance
 

Detailed Description

I feel dirty, but I don't know how to ensure we don't leak Bitmaps if we make a new cache for every GameActivity. If I clean up in onPause I get errors because some of the Bitmaps I am recycling are still being used in another thread.

So, a singleton that is also stateful because we update the loader because we get a new Resources instance, just in case old ones become invalid.

Please, tell me how to do this better.

Constructor & Destructor Documentation

rabbitescape.ui.android.SingletonBitmapCache.SingletonBitmapCache ( )
private

Don't construct one of these.

Member Function Documentation

static long rabbitescape.ui.android.SingletonBitmapCache.cacheSize ( )
staticprivate
static synchronized BitmapCache<AndroidBitmap> rabbitescape.ui.android.SingletonBitmapCache.instance ( Resources  resources)
static

Member Data Documentation

BitmapCache<AndroidBitmap> rabbitescape.ui.android.SingletonBitmapCache.theInstance
staticprivate

The documentation for this class was generated from the following file: