Files
react-native/ReactAndroid/src/main/java/com/facebook/jni/JniTerminateHandler.java
Pieter De Baets f0e4a6cd2c Add missing Java files to RN fbjni sync
Reviewed By: mhorowitz

Differential Revision: D5129224

fbshipit-source-id: d9fb5f95505f6be7d3d87ead67dbfaa951c03434
2017-05-30 03:19:04 -07:00

16 lines
518 B
Java

// Copyright 2004-present Facebook. All Rights Reserved.
package com.facebook.jni;
public class JniTerminateHandler {
public static void handleTerminate(Throwable t) throws Throwable {
Thread.UncaughtExceptionHandler h = Thread.getDefaultUncaughtExceptionHandler();
if (h == null) {
// Odd. Let the default std::terminate_handler deal with it.
return;
}
h.uncaughtException(Thread.currentThread(), t);
// That should exit. If it doesn't, let the default handler deal with it.
}
}