Run garbage collector when game is reset or started
Co-authored-by: r3cp3ct <45179536+r3cp3ct@users.noreply.github.com> Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
This commit is contained in:
parent
effdf8b79f
commit
27d5e9ec64
Binary file not shown.
Binary file not shown.
@ -155,9 +155,11 @@ public class RabiClone{
|
||||
player=null;
|
||||
level_renderer=null;
|
||||
control_settings_menu=null;
|
||||
System.gc();
|
||||
}
|
||||
|
||||
private static void StartGame() {
|
||||
System.gc();
|
||||
OBJ.add(player = new Player(p));
|
||||
OBJ.add(new Erinoah(p));
|
||||
}
|
||||
@ -181,11 +183,6 @@ public class RabiClone{
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
} else {
|
||||
if (System.currentTimeMillis()-lastReportedTime>1000) {
|
||||
System.err.println("WARNING! Update loop is underperforming!");
|
||||
lastReportedTime=System.currentTimeMillis();
|
||||
}
|
||||
}
|
||||
lastUpdate=newTime;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user