Fixes issues with the assembly resolver getting disposed when launched in nogui mode.

This should solve #102, #104.
This commit is contained in:
Westin Miller
2017-09-07 02:03:48 -07:00
parent 2fb222125a
commit cfda1f8eef

View File

@@ -8,6 +8,7 @@ using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Threading;
using NLog;
using Torch.Utils;
@@ -84,15 +85,15 @@ quit";
_server = new TorchServer(_config);
_server.Init();
if (_config.NoGui || _config.Autostart)
{
new Thread(_server.Start).Start();
}
if (!_config.NoGui)
{
new TorchUI(_server).ShowDialog();
var ui = new TorchUI(_server);
if (_config.Autostart)
new Thread(_server.Start).Start();
ui.ShowDialog();
}
else
_server.Start();
_resolver?.Dispose();
}