Skip to content

Commit

Permalink
Skip log if Gdx.app is null, fix dispose jni miniaudio global ref
Browse files Browse the repository at this point in the history
  • Loading branch information
fgnm committed Dec 13, 2023
1 parent c8155bd commit 3eb09e1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main/java/games/rednblack/miniaudio/MiniAudio.java
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ public void dispose() {
#if defined(MA_ANDROID)
ma_free(androidVFS, NULL);
#endif
env->DeleteGlobalRef(jMiniAudio);
*/

/**
Expand Down Expand Up @@ -1948,6 +1949,8 @@ public void on_native_sound_end(long soundAddress) {
}

public void on_native_log(int level, String message) {
if (Gdx.app == null) return;

switch (level) {
case 1:
case 2:
Expand Down

0 comments on commit 3eb09e1

Please sign in to comment.