private void _ShutdownErrorReporting() { // Remove event handlers first! AppDomain.CurrentDomain.UnhandledException -= _AppDomainUnhandledException; DispatcherUnhandledException -= _DispatcherUnhandledException; TaskScheduler.UnobservedTaskException -= _TaskSchedulerUnobservedTaskException; if (_uploader != null) { if (_uploader.HasPendingWork) { Splashscreen.ShowSplash("Waiting for uploader to finish ..."); string msg = ""; while (_uploader.HasPendingWork) { msg += "."; Splashscreen.SetMessage(msg); Thread.Sleep(250); } Splashscreen.HideSplash(); } _uploader.Close(); } _uploader = null; }