Crash handler fix
@@ -355,6 +355,7 @@ public class AndroidGraphics extends Graphics implements Renderer{
@Override
public void onDrawFrame(GL10 gl){
+ try{
long time = System.nanoTime();
deltaTime = (time - lastFrameTime) / 1000000000.0f;
lastFrameTime = time;
@@ -411,24 +412,20 @@ public class AndroidGraphics extends Graphics implements Renderer{
app.getRunnables().clear();
}
- runProtected(() -> {
for(int i = 0; i < app.getExecutedRunnables().size; i++){
app.getExecutedRunnables().get(i).run();
}
- });
((AndroidInput)Core.input).processEvents();
frameId++;
app.defaultUpdate();
Seq<ApplicationListener> listeners = app.getListeners();
- runProtected(() -> {
synchronized(listeners){
for(int i = 0, n = listeners.size; i < n; ++i){
listeners.get(i).update();
}
}
- });
((AndroidInput)Core.input).processDevices();
}
@@ -464,11 +461,6 @@ public class AndroidGraphics extends Graphics implements Renderer{
frameStart = time;
}
frames++;
- }
-
- private void runProtected(Runnable run){
- try{
- run.run();
}catch(Throwable t){
if(config.errorHandler != null){
app.getListeners().clear();
