OSDN Git Service

fixed memory leak when the app was running in background, we don't generate textures...
authorVenkat Krishnaraj <venkatkrishnaraj@venkat-krishnarajs-macbook-pro.local>
Tue, 8 Dec 2009 22:23:03 +0000 (14:23 -0800)
committerDave Sparks <davidsparks@android.com>
Wed, 9 Dec 2009 03:44:05 +0000 (19:44 -0800)
src/com/cooliris/cache/CacheService.java
src/com/cooliris/media/MediaFeed.java

index e075d78..2b08809 100644 (file)
@@ -724,6 +724,7 @@ public final class CacheService extends IntentService {
                 thumbnailCache.put(thumbId, retVal);
             }
             cacheOutput.close();
+            finalBitmap.recycle();
         } catch (Exception e) {
             ;
         }
index 8c9eefa..62fa084 100644 (file)
@@ -431,6 +431,8 @@ public final class MediaFeed implements Runnable {
                 sleepMs = 300;
                 if (!mMediaFeedNeedsToRun)
                     continue;
+                if (((Gallery) mContext).isPaused())
+                    continue;
                 mMediaFeedNeedsToRun = false;
                 ArrayList<MediaSet> mediaSets = mMediaSets;
                 synchronized (mediaSets) {