v2.2.0: added various safety checks to prevent rare crash errors
This commit is contained in:
@@ -280,6 +280,7 @@ public class Group extends Gizmo {
|
||||
}
|
||||
|
||||
public synchronized void clear() {
|
||||
if (length == 0) return;
|
||||
for (int i=0; i < length; i++) {
|
||||
Gizmo g = members.get( i );
|
||||
if (g != null) {
|
||||
|
||||
@@ -79,9 +79,13 @@ public enum Sample {
|
||||
@Override
|
||||
public void run() {
|
||||
for (String asset : toLoad) {
|
||||
Sound newSound = Gdx.audio.newSound(Gdx.files.internal(asset));
|
||||
synchronized (INSTANCE) {
|
||||
ids.put(asset, newSound);
|
||||
try {
|
||||
Sound newSound = Gdx.audio.newSound(Gdx.files.internal(asset));
|
||||
synchronized (INSTANCE) {
|
||||
ids.put(asset, newSound);
|
||||
}
|
||||
} catch (Exception e){
|
||||
Game.reportException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user