Skip to content

Commit

Permalink
release audio if initialization fails
Browse files Browse the repository at this point in the history
  • Loading branch information
xdsopl committed Jul 3, 2024
1 parent 879b524 commit 55f2726
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/src/main/java/xdsopl/robot36/MainActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ private void initAudioRecord() {
}
startListening();
} else {
audioRecord.release();
audioRecord = null;
setStatus(R.string.audio_init_failed);
}
} catch (IllegalArgumentException e) {
Expand Down

0 comments on commit 55f2726

Please sign in to comment.