jni/native_crash_handler.c
void sigaction_callback(int signal, siginfo_t *info, void *reserved)
{
    // Call the Java LibVLC method that handle the crash.
    JNIEnv *env;
    (*myVm)->AttachCurrentThread(myVm, &env, NULL);

    jclass cls = (*env)->GetObjectClass(env, j_libVLC);
    jmethodID methodId = (*env)->GetMethodID(env, cls, "onNativeCrash", "()V");
    (*env)->CallVoidMethod(env, j_libVLC, methodId);

    (*env)->DeleteLocalRef(env, cls);
    (*myVm)->DetachCurrentThread(myVm);

    // Call the old signal handler.
    old_actions[signal].sa_handler(signal);
}
/**
 * Callback called when a monitored signal is triggered.
 */
Callback called when a monitored signal is triggered.
Callback called when a monitored signal is triggered .
void sigaction_callback(int signal, siginfo_t *info, void *reserved)
{
    JNIEnv *env;
    (*myVm)->AttachCurrentThread(myVm, &env, NULL);
    jclass cls = (*env)->GetObjectClass(env, j_libVLC);
    jmethodID methodId = (*env)->GetMethodID(env, cls, "onNativeCrash", "()V");
    (*env)->CallVoidMethod(env, j_libVLC, methodId);
    (*env)->DeleteLocalRef(env, cls);
    (*myVm)->DetachCurrentThread(myVm);
    old_actions[signal].sa_handler(signal);
}
void sigaction_callback ( int signal , siginfo_t * info , void * reserved ) { JNIEnv * env ; ( * myVm ) -> AttachCurrentThread ( myVm , & env , NULL ) ; jclass cls = ( * env ) -> GetObjectClass ( env , j_libVLC ) ; jmethodID methodId = ( * env ) -> GetMethodID ( env , cls , " " , " " ) ; ( * env ) -> CallVoidMethod ( env , j_libVLC , methodId ) ; ( * env ) -> DeleteLocalRef ( env , cls ) ; ( * myVm ) -> DetachCurrentThread ( myVm ) ; old_actions [ signal ] . sa_handler ( signal ) ; }
Callback called when a monitored signal is triggered.
Callback called when a monitored signal is triggered .
// Call the Java LibVLC method that handle the crash. // Call the old signal handler.