diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Main.cxx b/src/Main.cxx index d8384abfb..e41489688 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -696,6 +696,7 @@ int mpd_main(int argc, char *argv[]) #endif delete instance->event_loop; delete instance; + instance = nullptr; #ifndef ANDROID daemonize_finish(); #endif @@ -727,4 +728,12 @@ Java_org_musicpd_Bridge_run(JNIEnv *env, jclass, jobject _context) Environment::Deinitialise(env); } +gcc_visibility_default +JNIEXPORT void JNICALL +Java_org_musicpd_Bridge_shutdown(JNIEnv *, jclass) +{ + if (instance != nullptr) + instance->event_loop->Break(); +} + #endif |