using Microsoft.Win32;
using System.Security.Permissions;
using System.Runtime.InteropServices;
+using System.Threading;
namespace LibCECTray.ui
{
XBMC
}
+ class AsyncDisconnect
+ {
+ public AsyncDisconnect(CECController controller)
+ {
+ _controller = controller;
+ }
+
+ public void Process()
+ {
+ _controller.Close();
+ }
+
+ private CECController _controller;
+ }
+
/// <summary>
/// Main LibCecTray GUI
/// </summary>
protected override void Dispose(bool disposing)
{
Hide();
- SuppressLogUpdates = true;
if (disposing)
{
Controller.CECActions.SuppressUpdates = true;
- Controller.Close();
+ AsyncDisconnect dc = new AsyncDisconnect(Controller);
+ (new Thread(dc.Process)).Start();
}
if (disposing && (components != null))
{
delegate void UpdateLogCallback();
private void UpdateLog()
{
- if (SuppressLogUpdates)
- return;
-
if (tbLog.InvokeRequired)
{
UpdateLogCallback d = UpdateLog;
#endregion
#region Class members
- private bool SuppressLogUpdates = false;
private ConfigTab _selectedTab = ConfigTab.Configuration;
private string _log = string.Empty;
private CECController _controller;