protected override void OnExit(ExitEventArgs e) { base.OnExit(e); if (dispatcherTimer != null) { dispatcherTimer.Stop(); dispatcherTimer = null; } if (ProfilerApp != null) { ProfilerApp.Dispose(); ProfilerApp = null; } }