From 3751e14eb1b7a0815b6ab7c2164c262e4723c52e Mon Sep 17 00:00:00 2001 From: LukePulverenti Date: Tue, 26 Feb 2013 23:19:05 -0500 Subject: restored audio --- .../Sqlite/SQLiteRepository.cs | 36 ++++++++++++---------- 1 file changed, 19 insertions(+), 17 deletions(-) (limited to 'MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs') diff --git a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs index dead97959..83b7c0eb0 100644 --- a/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs +++ b/MediaBrowser.Server.Implementations/Sqlite/SQLiteRepository.cs @@ -143,20 +143,28 @@ namespace MediaBrowser.Server.Implementations.Sqlite { if (dispose) { - Logger.Info("Disposing " + GetType().Name); - try { - // If we're not already flushing, do it now - if (!IsFlushing) - { - Flush(null); - } - - // Don't dispose in the middle of a flush - while (IsFlushing) + if (connection != null) { - Thread.Sleep(50); + // If we're not already flushing, do it now + if (!IsFlushing) + { + Flush(null); + } + + // Don't dispose in the middle of a flush + while (IsFlushing) + { + Thread.Sleep(50); + } + + if (connection.IsOpen()) + { + connection.Close(); + } + + connection.Dispose(); } if (FlushTimer != null) @@ -165,12 +173,6 @@ namespace MediaBrowser.Server.Implementations.Sqlite FlushTimer = null; } - if (connection.IsOpen()) - { - connection.Close(); - } - - connection.Dispose(); } catch (Exception ex) { -- cgit v1.2.3