Skip to content

Commit

Permalink
Unregister events in Dispose
Browse files Browse the repository at this point in the history
  • Loading branch information
fatalis committed Aug 27, 2015
1 parent cd81ced commit 3fd2c37
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion LiveSplit.MirrorsEdge/MirrorsEdgeComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class MirrorsEdgeComponent : LogicComponent
public MirrorsEdgeComponent(LiveSplitState state)
{
_timer = new TimerModel() { CurrentState = state };
_timer.OnStart += (sender, args) => _timer.InitializeGameTime();
_timer.OnStart += timer_OnStart;
this.Settings = new MirrorsEdgeSettings(_timer);

//this.ExtractGameHooksDLL();
Expand All @@ -34,6 +34,7 @@ public MirrorsEdgeComponent(LiveSplitState state)

public override void Dispose()
{
_timer.OnStart -= timer_OnStart;
_gameProcess?.Stop();
}

Expand Down Expand Up @@ -72,6 +73,11 @@ public override void Dispose()
}
}*/

void timer_OnStart(object sender, EventArgs e)
{
_timer.InitializeGameTime();
}

void gameProcess_OnPause(object sender, EventArgs e)
{
_timer.CurrentState.IsGameTimePaused = true;
Expand Down

0 comments on commit 3fd2c37

Please sign in to comment.