Skip to content

Commit

Permalink
Reorder delegate operations
Browse files Browse the repository at this point in the history
  • Loading branch information
ASleepyCat committed Apr 27, 2021
1 parent 3a4c72c commit b9c6488
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Main/src/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,9 @@ Track::Track()

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

delete loader;
for (auto & i : m_laserTrackBuilder)
delete i;
for (auto & m_hitEffect : m_hitEffects)
Expand All @@ -39,6 +36,8 @@ Track::~Track()

bool Track::AsyncLoad()
{
g_input.OnButtonReleased.Add(this, &Track::OnButtonReleased);

loader = new AsyncAssetLoader();
String skin = g_application->GetCurrentSkin();

Expand Down Expand Up @@ -228,8 +227,6 @@ bool Track::AsyncFinalize()
timedHitEffect->time = 0;
timedHitEffect->track = this;

g_input.OnButtonReleased.Add(this, &Track::OnButtonReleased);

bool delayedHitEffects = g_gameConfig.GetBool(GameConfigKeys::DelayedHitEffects);

for (int i = 0; i < 6; ++i)
Expand Down

0 comments on commit b9c6488

Please sign in to comment.