aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Mono/Program.cs
diff options
context:
space:
mode:
authorLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-27 08:24:28 -0400
committerLuke Pulverenti <luke.pulverenti@gmail.com>2013-09-27 08:24:28 -0400
commitc643dd072e117aec2397e695c650e8a58be2fc6c (patch)
treeea1701ef7408fb30c816d6495ba85c200f4bacdb /MediaBrowser.Server.Mono/Program.cs
parentbdc90f02f2aea7fabc22413912752db56435bfd3 (diff)
added more direct querying to folder
Diffstat (limited to 'MediaBrowser.Server.Mono/Program.cs')
-rw-r--r--MediaBrowser.Server.Mono/Program.cs20
1 files changed, 13 insertions, 7 deletions
diff --git a/MediaBrowser.Server.Mono/Program.cs b/MediaBrowser.Server.Mono/Program.cs
index 1a3ce414e..d413041b5 100644
--- a/MediaBrowser.Server.Mono/Program.cs
+++ b/MediaBrowser.Server.Mono/Program.cs
@@ -23,6 +23,8 @@ namespace MediaBrowser.Server.Mono
private static ILogger _logger;
+ private static MainWindow _mainWindow;
+
public static void Main (string[] args)
{
Application.Init ();
@@ -42,11 +44,11 @@ namespace MediaBrowser.Server.Mono
var runningPath = Process.GetCurrentProcess().MainModule.FileName.Replace(Path.DirectorySeparatorChar.ToString(), string.Empty);
- _singleInstanceMutex = new Mutex(true, @"Local\" + runningPath, out createdNew);
-
+ //_singleInstanceMutex = new Mutex(true, @"Local\" + runningPath, out createdNew);
+ createdNew = true;
if (!createdNew)
{
- _singleInstanceMutex = null;
+ //_singleInstanceMutex = null;
logger.Info("Shutting down because another instance of Media Browser Server is already running.");
return;
}
@@ -65,7 +67,7 @@ namespace MediaBrowser.Server.Mono
{
logger.Info("Shutting down");
- ReleaseMutex(logger);
+ //ReleaseMutex(logger);
_appHost.Dispose();
}
@@ -91,9 +93,9 @@ namespace MediaBrowser.Server.Mono
Task.WaitAll (task);
// TODO: Hide splash here
- MainWindow win = new MainWindow ();
+ _mainWindow = new MainWindow ();
- win.Show ();
+ _mainWindow.Show ();
Application.Run ();
}
@@ -172,16 +174,20 @@ namespace MediaBrowser.Server.Mono
public static void Shutdown()
{
+ _mainWindow.Hide ();
+ _mainWindow.Dispose ();
Application.Quit ();
}
public static void Restart()
{
// Second instance will start first, so release the mutex and dispose the http server ahead of time
- ReleaseMutex (_logger);
+ //ReleaseMutex (_logger);
_appHost.Dispose();
+ _mainWindow.Hide ();
+ _mainWindow.Dispose ();
Application.Quit ();
}
}