Skip to content

Commit

Permalink
fixed sound bug
Browse files Browse the repository at this point in the history
  • Loading branch information
gustavo-tomas committed Jul 1, 2022
1 parent 0f607ff commit 6e6d3d1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Sound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Sound::~Sound()
{
if (chunk != nullptr)
{
Mix_HaltChannel(channel);
if (channel >= -1)
Mix_HaltChannel(channel);
Mix_FreeChunk(chunk);
cout << "Sound deleted successfully!" << endl;
}
Expand Down

0 comments on commit 6e6d3d1

Please sign in to comment.