mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-11 22:40:37 +08:00
Reviewed By: mhorowitz Differential Revision: D5129224 fbshipit-source-id: d9fb5f95505f6be7d3d87ead67dbfaa951c03434
16 lines
518 B
Java
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.
|
|
}
|
|
}
|