Skip to content

Commit

Permalink
more small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-tomas committed Jul 1, 2022
1 parent 450db9f commit c3ab50a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ void Sound::Play(int times)

void Sound::Stop()
{
if (chunk != nullptr)
if (chunk != nullptr && channel >= -1)
Mix_HaltChannel(channel);
}

Expand All @@ -29,7 +29,7 @@ void Sound::Open(const char* file)

Sound::~Sound()
{

Stop();
}

bool Sound::IsOpen()
Expand Down

0 comments on commit c3ab50a

Please sign in to comment.