Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Commit

Permalink
Delete current thread after stopping sounds
Browse files Browse the repository at this point in the history
  • Loading branch information
CiroZDP committed Apr 26, 2024
1 parent 77809a9 commit 9574d00
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/net/op/sound/SoundManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public static void playRandomSound() {
public static void stopSounds() {
if (currentSoundThread == null)
return;

if (!currentSoundThread.isAlive()) {
currentSoundThread = null;
return;
}

try {
currentSoundThread.stop();
Expand Down

0 comments on commit 9574d00

Please sign in to comment.