Skip to content

Commit

Permalink
Fix assertion failing when exiting while a chart is loading
Browse files Browse the repository at this point in the history
  • Loading branch information
ASleepyCat committed Apr 27, 2021
1 parent b72ae68 commit 1452c99
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 0 additions & 2 deletions Main/src/Game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,6 @@ class Game_Impl : public Game

~Game_Impl()
{
if (m_track)
g_input.OnButtonReleased.Remove(m_track, &Track::OnButtonReleased);
delete m_track;
delete m_background;
delete m_foreground;
Expand Down
6 changes: 5 additions & 1 deletion Main/src/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,11 @@ Track::Track()

Track::~Track()
{
delete loader;
if (loader)
{
delete loader;
g_input.OnButtonReleased.Remove(this, &Track::OnButtonReleased);
}

for (auto & i : m_laserTrackBuilder)
delete i;
Expand Down

0 comments on commit 1452c99

Please sign in to comment.