private void StateChangedEventHandler(HeaptrackSessionState newState) { if (newState == HeaptrackSessionState.Finished || newState == HeaptrackSessionState.Failed) { if (newState == HeaptrackSessionState.Finished) { Task.Run(() => OnSessionFinished?.Invoke(this, new EventArgs())); } HeaptrackSession s = _currentSession; _currentSession = null; if (s != null) { s.Destroy(); } } }
public void EndSession(GameFinishedEvent evt) { AddEvent(evt); OnSessionFinished?.Invoke(); }