ma_device_stop locks until audio worker ends. It's better called before freeing memory

This commit is contained in:
Paolo Marrone 2024-02-02 17:32:14 +01:00
parent 54e5a539a4
commit 16ed63107f

View File

@ -267,14 +267,13 @@ JNIEXPORT void JNICALL
JNI_FUNC(nativeAudioStop)(JNIEnv* env, jobject thiz) { JNI_FUNC(nativeAudioStop)(JNIEnv* env, jobject thiz) {
(void)env; (void)env;
(void)thiz; (void)thiz;
if (mem != NULL)
free(mem);
plugin_fini(&instance);
#if NUM_CHANNELS_IN + NUM_CHANNELS_OUT > 0 #if NUM_CHANNELS_IN + NUM_CHANNELS_OUT > 0
ma_device_stop(&device); ma_device_stop(&device);
ma_device_uninit(&device); ma_device_uninit(&device);
#endif #endif
if (mem != NULL)
free(mem);
plugin_fini(&instance);
} }
extern "C" extern "C"