Moved kernel dispose to application.onexit
This commit is contained in:
parent
aba42c3c61
commit
b50a15aaf4
|
@ -5,6 +5,7 @@ using System.Data;
|
|||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using MediaBrowser.Controller;
|
||||
|
||||
namespace MediaBrowser.ServerApplication
|
||||
{
|
||||
|
@ -13,5 +14,11 @@ namespace MediaBrowser.ServerApplication
|
|||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
protected override void OnExit(ExitEventArgs e)
|
||||
{
|
||||
base.OnExit(e);
|
||||
|
||||
Kernel.Instance.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:tb="http://www.hardcodet.net/taskbar"
|
||||
Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ShowInTaskbar="False" Closing="MainWindow_Closing" Loaded="MainWindow_Loaded">
|
||||
Title="MainWindow" Height="350" Width="525" AllowsTransparency="True" Background="Transparent" WindowStyle="None" ShowInTaskbar="False" Loaded="MainWindow_Loaded">
|
||||
<Grid>
|
||||
<tb:TaskbarIcon Name="MbTaskbarIcon" IconSource="/Icons/Icon.ico" ToolTipText="MediaBrowser Server" Visibility="Hidden">
|
||||
|
||||
|
|
|
@ -38,15 +38,11 @@ namespace MediaBrowser.ServerApplication
|
|||
|
||||
try
|
||||
{
|
||||
DateTime now = DateTime.Now;
|
||||
|
||||
splash.Show();
|
||||
|
||||
kernel = new Kernel();
|
||||
|
||||
kernel.Init(progress);
|
||||
|
||||
var time = DateTime.Now - now;
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
@ -64,11 +60,6 @@ namespace MediaBrowser.ServerApplication
|
|||
// Don't show the system tray icon until the app has loaded.
|
||||
this.MbTaskbarIcon.Visibility = System.Windows.Visibility.Visible;
|
||||
}
|
||||
|
||||
private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
kernel.Dispose();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user