disposing assets that weren't properly disposed
This commit is contained in:
parent
72b91a53fe
commit
8f03c3310d
@ -119,6 +119,12 @@ public class BasicVisualizer extends VisualizerCore {
|
||||
@Override
|
||||
public void dispose() {
|
||||
bar.dispose();
|
||||
for (int i = 0; i < textures.length; i++) {
|
||||
textures[i].dispose();
|
||||
}
|
||||
if (mm != null) {
|
||||
mm.dispose();
|
||||
}
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,7 @@ public class TitleBarVisualizer extends Group implements Disposable {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
visual.dispose();
|
||||
bgTexture.dispose();
|
||||
}
|
||||
|
||||
|
@ -4,11 +4,12 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.graphics.Color;
|
||||
import com.badlogic.gdx.graphics.g2d.Batch;
|
||||
import com.badlogic.gdx.scenes.scene2d.ui.Widget;
|
||||
import com.badlogic.gdx.utils.Disposable;
|
||||
|
||||
import zero1hd.rhythmbullet.audio.MusicManager;
|
||||
import zero1hd.rhythmbullet.audio.visualizer.BasicVisualizer;
|
||||
|
||||
public class Visualizer extends Widget {
|
||||
public class Visualizer extends Widget implements Disposable {
|
||||
private BasicVisualizer vis;
|
||||
private boolean updatePositioning = true;
|
||||
private boolean mmSet;
|
||||
@ -45,6 +46,9 @@ public class Visualizer extends Widget {
|
||||
|
||||
|
||||
public void setMM(MusicManager mm) {
|
||||
if (mm != null) {
|
||||
mm.dispose();
|
||||
}
|
||||
this.mm = mm;
|
||||
mmSet = false;
|
||||
}
|
||||
@ -90,4 +94,9 @@ public class Visualizer extends Widget {
|
||||
return vis;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
vis.dispose();
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -107,6 +107,7 @@ public class MainPage extends Page implements Observer {
|
||||
|
||||
@Override
|
||||
public void dispose() {
|
||||
titleBar.dispose();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user