aboutsummaryrefslogtreecommitdiffstats
path: root/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java')
-rw-r--r--src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java
index f01c86c..d548e0a 100644
--- a/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java
+++ b/src/org/cyanogenmod/wallpapers/photophase/PhotoPhaseWallpaperWorld.java
@@ -226,8 +226,10 @@ public class PhotoPhaseWallpaperWorld {
/**
* Method that removes all internal references.
+ *
+ * @param full Indicates a full recycle (textures also)
*/
- public void recycle() {
+ public void recycle(boolean full) {
// Destroy the previous world
if (mTransitions != null) {
int cc = mTransitions.size() - 1;
@@ -252,6 +254,14 @@ public class PhotoPhaseWallpaperWorld {
if (mUsedTransitionsQueue != null) {
mUsedTransitionsQueue.clear();
}
+ if (mPhotoFrames != null && full) {
+ int cc = mPhotoFrames.size() - 1;
+ for (int i = cc; i >= 0; i--) {
+ PhotoFrame frame = mPhotoFrames.get(i);
+ frame.recycle();
+ mPhotoFrames.remove(i);
+ }
+ }
mRecycled = true;
}
@@ -282,7 +292,7 @@ public class PhotoPhaseWallpaperWorld {
// Destroy the previous world
if (mRecycled) {
- recycle();
+ recycle(false);
mRecycled = false;
}