aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations
diff options
context:
space:
mode:
authorLuke <luke.pulverenti@gmail.com>2017-09-05 15:49:26 -0400
committerGitHub <noreply@github.com>2017-09-05 15:49:26 -0400
commit5116b175ce4a1f3a54c64c6f8fa8e8fba1a69e1a (patch)
treece6784069ed4cb412c917dc1e3d884c56dea2654 /Emby.Server.Implementations
parent637795aaf5e203d3a5a98cf9caa742663d0ee14e (diff)
parent49b799adbe3d65973b136bee758584748ecf6c2a (diff)
Merge pull request #2866 from MediaBrowser/dev
3.2.30.8
Diffstat (limited to 'Emby.Server.Implementations')
-rw-r--r--Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs1
-rw-r--r--Emby.Server.Implementations/ApplicationHost.cs4
-rw-r--r--Emby.Server.Implementations/Channels/ChannelManager.cs1
-rw-r--r--Emby.Server.Implementations/Data/ManagedConnection.cs1
-rw-r--r--Emby.Server.Implementations/Diagnostics/CommonProcess.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/LoadRegistrations.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/StartupWizard.cs4
-rw-r--r--Emby.Server.Implementations/EntryPoints/SystemEvents.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs1
-rw-r--r--Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs1
-rw-r--r--Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs21
-rw-r--r--Emby.Server.Implementations/HttpServer/SocketSharp/SharpWebSocket.cs1
-rw-r--r--Emby.Server.Implementations/IO/FileRefresher.cs1
-rw-r--r--Emby.Server.Implementations/IO/IsoManager.cs1
-rw-r--r--Emby.Server.Implementations/IO/LibraryMonitor.cs1
-rw-r--r--Emby.Server.Implementations/Library/MediaSourceManager.cs1
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs1
-rw-r--r--Emby.Server.Implementations/LiveTv/EmbyTV/EntryPoint.cs4
-rw-r--r--Emby.Server.Implementations/LiveTv/LiveTvManager.cs1
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs2
-rw-r--r--Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs1
-rw-r--r--Emby.Server.Implementations/Logging/SimpleLogManager.cs15
-rw-r--r--Emby.Server.Implementations/Net/NetAcceptSocket.cs1
-rw-r--r--Emby.Server.Implementations/News/NewsEntryPoint.cs1
-rw-r--r--Emby.Server.Implementations/Notifications/Notifications.cs1
-rw-r--r--Emby.Server.Implementations/Notifications/WebSocketNotifier.cs4
-rw-r--r--Emby.Server.Implementations/Session/HttpSessionController.cs6
-rw-r--r--Emby.Server.Implementations/Session/SessionWebSocketListener.cs1
-rw-r--r--Emby.Server.Implementations/Session/WebSocketController.cs1
-rw-r--r--Emby.Server.Implementations/TV/SeriesPostScanTask.cs1
-rw-r--r--Emby.Server.Implementations/Threading/CommonTimer.cs1
-rw-r--r--Emby.Server.Implementations/Updates/InstallationManager.cs1
40 files changed, 59 insertions, 36 deletions
diff --git a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
index 1b6daca73..4e448ac64 100644
--- a/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
+++ b/Emby.Server.Implementations/Activity/ActivityLogEntryPoint.cs
@@ -491,6 +491,7 @@ namespace Emby.Server.Implementations.Activity
//_logManager.LoggerLoaded -= _logManager_LoggerLoaded;
_appHost.ApplicationUpdated -= _appHost_ApplicationUpdated;
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/ApplicationHost.cs b/Emby.Server.Implementations/ApplicationHost.cs
index b264cffe6..b3268b156 100644
--- a/Emby.Server.Implementations/ApplicationHost.cs
+++ b/Emby.Server.Implementations/ApplicationHost.cs
@@ -828,7 +828,7 @@ namespace Emby.Server.Implementations
RegisterSingleInstance(MemoryStreamFactory);
RegisterSingleInstance(SystemEvents);
- RegisterSingleInstance(LogManager);
+ RegisterSingleInstance(LogManager, false);
RegisterSingleInstance(Logger);
RegisterSingleInstance(EnvironmentInfo);
@@ -2341,6 +2341,7 @@ namespace Emby.Server.Implementations
_disposed = true;
Dispose(true);
+ GC.SuppressFinalize(this);
}
}
@@ -2354,6 +2355,7 @@ namespace Emby.Server.Implementations
{
var type = GetType();
+ LogManager.AddConsoleOutput();
Logger.Info("Disposing " + type.Name);
var parts = DisposableParts.Distinct().Where(i => i.GetType() != type).ToList();
diff --git a/Emby.Server.Implementations/Channels/ChannelManager.cs b/Emby.Server.Implementations/Channels/ChannelManager.cs
index e842005a5..2f726f8ab 100644
--- a/Emby.Server.Implementations/Channels/ChannelManager.cs
+++ b/Emby.Server.Implementations/Channels/ChannelManager.cs
@@ -1624,6 +1624,7 @@ namespace Emby.Server.Implementations.Channels
public void Dispose()
{
+ GC.SuppressFinalize(this);
}
}
} \ No newline at end of file
diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.cs
index 91a2dfdf6..5d0fc8ebc 100644
--- a/Emby.Server.Implementations/Data/ManagedConnection.cs
+++ b/Emby.Server.Implementations/Data/ManagedConnection.cs
@@ -77,6 +77,7 @@ namespace Emby.Server.Implementations.Data
{
Close();
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
index 09b8bf22c..a0a5f32ef 100644
--- a/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
+++ b/Emby.Server.Implementations/Diagnostics/CommonProcess.cs
@@ -104,6 +104,7 @@ namespace Emby.Server.Implementations.Diagnostics
public void Dispose()
{
_process.Dispose();
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
index 561f5ee12..c2cee00c8 100644
--- a/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/AutomaticRestartEntryPoint.cs
@@ -112,6 +112,7 @@ namespace Emby.Server.Implementations.EntryPoints
_appHost.HasPendingRestartChanged -= _appHost_HasPendingRestartChanged;
DisposeTimer();
+ GC.SuppressFinalize(this);
}
private void DisposeTimer()
diff --git a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
index c96799b2f..9b434d606 100644
--- a/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
+++ b/Emby.Server.Implementations/EntryPoints/ExternalPortForwarding.cs
@@ -294,6 +294,7 @@ namespace Emby.Server.Implementations.EntryPoints
{
_disposed = true;
DisposeNat();
+ GC.SuppressFinalize(this);
}
private void DisposeNat()
diff --git a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
index 8ae85e390..221580681 100644
--- a/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
+++ b/Emby.Server.Implementations/EntryPoints/KeepServerAwake.cs
@@ -60,6 +60,7 @@ namespace Emby.Server.Implementations.EntryPoints
_timer.Dispose();
_timer = null;
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
index 80a188bc0..796d8cf48 100644
--- a/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/LibraryChangedNotifier.cs
@@ -426,6 +426,7 @@ namespace Emby.Server.Implementations.EntryPoints
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/EntryPoints/LoadRegistrations.cs b/Emby.Server.Implementations/EntryPoints/LoadRegistrations.cs
index 0203b5192..21e075cf5 100644
--- a/Emby.Server.Implementations/EntryPoints/LoadRegistrations.cs
+++ b/Emby.Server.Implementations/EntryPoints/LoadRegistrations.cs
@@ -68,6 +68,7 @@ namespace Emby.Server.Implementations.EntryPoints
_timer.Dispose();
_timer = null;
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
index b674fc39b..f73b40b46 100644
--- a/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/RecordingNotifier.cs
@@ -72,6 +72,7 @@ namespace Emby.Server.Implementations.EntryPoints
_liveTvManager.SeriesTimerCancelled -= _liveTvManager_SeriesTimerCancelled;
_liveTvManager.TimerCreated -= _liveTvManager_TimerCreated;
_liveTvManager.SeriesTimerCreated -= _liveTvManager_SeriesTimerCreated;
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
index 77de849a1..13e14be36 100644
--- a/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
+++ b/Emby.Server.Implementations/EntryPoints/RefreshUsersMetadata.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Library;
+using System;
+using MediaBrowser.Controller.Library;
using MediaBrowser.Controller.Plugins;
using System.Threading;
@@ -36,6 +37,7 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
public void Dispose()
{
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
index 4d640bc95..514321e20 100644
--- a/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/ServerEventNotifier.cs
@@ -174,6 +174,7 @@ namespace Emby.Server.Implementations.EntryPoints
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
index 424153f22..614c04fd2 100644
--- a/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
+++ b/Emby.Server.Implementations/EntryPoints/StartupWizard.cs
@@ -1,4 +1,5 @@
-using Emby.Server.Implementations.Browser;
+using System;
+using Emby.Server.Implementations.Browser;
using MediaBrowser.Controller;
using MediaBrowser.Controller.Plugins;
using MediaBrowser.Model.Logging;
@@ -54,6 +55,7 @@ namespace Emby.Server.Implementations.EntryPoints
/// </summary>
public void Dispose()
{
+ GC.SuppressFinalize(this);
}
}
} \ No newline at end of file
diff --git a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
index 4ab6d32f3..aa63dae27 100644
--- a/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
+++ b/Emby.Server.Implementations/EntryPoints/SystemEvents.cs
@@ -43,6 +43,7 @@ namespace Emby.Server.Implementations.EntryPoints
public void Dispose()
{
_systemEvents.SystemShutdown -= _systemEvents_SystemShutdown;
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
index df5a7c985..d04df0d2b 100644
--- a/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UdpServerEntryPoint.cs
@@ -65,6 +65,7 @@ namespace Emby.Server.Implementations.EntryPoints
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
index 99d39ffe0..fb9402986 100644
--- a/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
+++ b/Emby.Server.Implementations/EntryPoints/UsageEntryPoint.cs
@@ -130,6 +130,7 @@ namespace Emby.Server.Implementations.EntryPoints
public void Dispose()
{
_sessionManager.SessionStarted -= _sessionManager_SessionStarted;
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
index accdc5e9d..4a7182a43 100644
--- a/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
+++ b/Emby.Server.Implementations/EntryPoints/UserDataChangeNotifier.cs
@@ -160,6 +160,7 @@ namespace Emby.Server.Implementations.EntryPoints
}
_userDataManager.UserDataSaved -= _userDataManager_UserDataSaved;
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
index f512b723d..fe545ecff 100644
--- a/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
+++ b/Emby.Server.Implementations/HttpClientManager/HttpClientManager.cs
@@ -823,27 +823,6 @@ namespace Emby.Server.Implementations.HttpClientManager
}
/// <summary>
- /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
- /// </summary>
- public void Dispose()
- {
- Dispose(true);
- GC.SuppressFinalize(this);
- }
-
- /// <summary>
- /// Releases unmanaged and - optionally - managed resources.
- /// </summary>
- /// <param name="dispose"><c>true</c> to release both managed and unmanaged resources; <c>false</c> to release only unmanaged resources.</param>
- protected virtual void Dispose(bool dispose)
- {
- if (dispose)
- {
- _httpClients.Clear();
- }
- }
-
- /// <summary>
/// Throws the cancellation exception.
/// </summary>
/// <param name="options">The options.</param>
diff --git a/Emby.Server.Implementations/HttpServer/SocketSharp/SharpWebSocket.cs b/Emby.Server.Implementations/HttpServer/SocketSharp/SharpWebSocket.cs
index 9823a2ff5..cc7a4557e 100644
--- a/Emby.Server.Implementations/HttpServer/SocketSharp/SharpWebSocket.cs
+++ b/Emby.Server.Implementations/HttpServer/SocketSharp/SharpWebSocket.cs
@@ -123,6 +123,7 @@ namespace Emby.Server.Implementations.HttpServer.SocketSharp
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/IO/FileRefresher.cs b/Emby.Server.Implementations/IO/FileRefresher.cs
index 0ec62d895..20de8a518 100644
--- a/Emby.Server.Implementations/IO/FileRefresher.cs
+++ b/Emby.Server.Implementations/IO/FileRefresher.cs
@@ -238,6 +238,7 @@ namespace Emby.Server.Implementations.IO
{
_disposed = true;
DisposeTimer();
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/IO/IsoManager.cs b/Emby.Server.Implementations/IO/IsoManager.cs
index 903d5f301..dc0b9e122 100644
--- a/Emby.Server.Implementations/IO/IsoManager.cs
+++ b/Emby.Server.Implementations/IO/IsoManager.cs
@@ -70,6 +70,7 @@ namespace Emby.Server.Implementations.IO
{
mounter.Dispose();
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/IO/LibraryMonitor.cs b/Emby.Server.Implementations/IO/LibraryMonitor.cs
index 3994e2b00..56b10a7e6 100644
--- a/Emby.Server.Implementations/IO/LibraryMonitor.cs
+++ b/Emby.Server.Implementations/IO/LibraryMonitor.cs
@@ -649,6 +649,7 @@ namespace Emby.Server.Implementations.IO
public void Dispose()
{
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/Library/MediaSourceManager.cs b/Emby.Server.Implementations/Library/MediaSourceManager.cs
index 6e0489d88..d60a04353 100644
--- a/Emby.Server.Implementations/Library/MediaSourceManager.cs
+++ b/Emby.Server.Implementations/Library/MediaSourceManager.cs
@@ -524,6 +524,7 @@ namespace Emby.Server.Implementations.Library
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
private readonly object _disposeLock = new object();
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
index 885e3b0ee..92a47bddc 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EmbyTV.cs
@@ -2630,6 +2630,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
pair.Value.CancellationTokenSource.Cancel();
}
+ GC.SuppressFinalize(this);
}
public List<VirtualFolderInfo> GetRecordingFolders()
diff --git a/Emby.Server.Implementations/LiveTv/EmbyTV/EntryPoint.cs b/Emby.Server.Implementations/LiveTv/EmbyTV/EntryPoint.cs
index 139cf570e..7c5f630a7 100644
--- a/Emby.Server.Implementations/LiveTv/EmbyTV/EntryPoint.cs
+++ b/Emby.Server.Implementations/LiveTv/EmbyTV/EntryPoint.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Plugins;
+using System;
+using MediaBrowser.Controller.Plugins;
namespace Emby.Server.Implementations.LiveTv.EmbyTV
{
@@ -11,6 +12,7 @@ namespace Emby.Server.Implementations.LiveTv.EmbyTV
public void Dispose()
{
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
index 089af2a01..b243c6599 100644
--- a/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
+++ b/Emby.Server.Implementations/LiveTv/LiveTvManager.cs
@@ -2779,6 +2779,7 @@ namespace Emby.Server.Implementations.LiveTv
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
private bool _isDisposed = false;
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
index eae29bee7..f974b5c2c 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunHost.cs
@@ -422,7 +422,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
SupportsTranscoding = true,
IsInfiniteStream = true,
IgnoreDts = true,
- //SupportsProbing = false,
+ SupportsProbing = false,
//AnalyzeDurationMs = 2000000
//IgnoreIndex = true,
//ReadAtNativeFramerate = true
diff --git a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs
index 41b058baf..c737c4cba 100644
--- a/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs
+++ b/Emby.Server.Implementations/LiveTv/TunerHosts/HdHomerun/HdHomerunManager.cs
@@ -99,6 +99,7 @@ namespace Emby.Server.Implementations.LiveTv.TunerHosts.HdHomerun
var task = StopStreaming();
Task.WaitAll(task);
+ GC.SuppressFinalize(this);
}
public async Task<bool> CheckTunerAvailability(IpAddressInfo remoteIp, int tuner, CancellationToken cancellationToken)
diff --git a/Emby.Server.Implementations/Logging/SimpleLogManager.cs b/Emby.Server.Implementations/Logging/SimpleLogManager.cs
index 3a6992657..6129f38c4 100644
--- a/Emby.Server.Implementations/Logging/SimpleLogManager.cs
+++ b/Emby.Server.Implementations/Logging/SimpleLogManager.cs
@@ -107,6 +107,7 @@ namespace Emby.Server.Implementations.Logging
}
_fileLogger = null;
+ GC.SuppressFinalize(this);
}
}
@@ -130,13 +131,18 @@ namespace Emby.Server.Implementations.Logging
private void LogInternal()
{
- while (!_cancellationTokenSource.IsCancellationRequested)
+ while (!_cancellationTokenSource.IsCancellationRequested && !_disposed)
{
try
{
foreach (var message in _queue.GetConsumingEnumerable())
{
var bytes = Encoding.UTF8.GetBytes(message + Environment.NewLine);
+ if (_disposed)
+ {
+ return;
+ }
+
_fileStream.Write(bytes, 0, bytes.Length);
_fileStream.Flush(true);
@@ -166,17 +172,18 @@ namespace Emby.Server.Implementations.Logging
return;
}
- _fileStream.Flush();
+ _fileStream.Flush(true);
}
public void Dispose()
{
_cancellationTokenSource.Cancel();
- _disposed = true;
+ Flush();
- _fileStream.Flush();
+ _disposed = true;
_fileStream.Dispose();
+ GC.SuppressFinalize(this);
}
}
diff --git a/Emby.Server.Implementations/Net/NetAcceptSocket.cs b/Emby.Server.Implementations/Net/NetAcceptSocket.cs
index 93638a367..d80341a07 100644
--- a/Emby.Server.Implementations/Net/NetAcceptSocket.cs
+++ b/Emby.Server.Implementations/Net/NetAcceptSocket.cs
@@ -92,6 +92,7 @@ namespace Emby.Server.Implementations.Net
public void Dispose()
{
Socket.Dispose();
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/News/NewsEntryPoint.cs b/Emby.Server.Implementations/News/NewsEntryPoint.cs
index 3c9a3bbf1..03c79c2c1 100644
--- a/Emby.Server.Implementations/News/NewsEntryPoint.cs
+++ b/Emby.Server.Implementations/News/NewsEntryPoint.cs
@@ -271,6 +271,7 @@ namespace Emby.Server.Implementations.News
_timer.Dispose();
_timer = null;
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/Notifications/Notifications.cs b/Emby.Server.Implementations/Notifications/Notifications.cs
index ac3cc7564..09c1f07e0 100644
--- a/Emby.Server.Implementations/Notifications/Notifications.cs
+++ b/Emby.Server.Implementations/Notifications/Notifications.cs
@@ -551,6 +551,7 @@ namespace Emby.Server.Implementations.Notifications
_deviceManager.CameraImageUploaded -= _deviceManager_CameraImageUploaded;
_userManager.UserLockedOut -= _userManager_UserLockedOut;
+ GC.SuppressFinalize(this);
}
private void DisposeLibraryUpdateTimer()
diff --git a/Emby.Server.Implementations/Notifications/WebSocketNotifier.cs b/Emby.Server.Implementations/Notifications/WebSocketNotifier.cs
index 0d89ba84f..6e57e7f81 100644
--- a/Emby.Server.Implementations/Notifications/WebSocketNotifier.cs
+++ b/Emby.Server.Implementations/Notifications/WebSocketNotifier.cs
@@ -1,4 +1,5 @@
-using MediaBrowser.Controller.Net;
+using System;
+using MediaBrowser.Controller.Net;
using MediaBrowser.Controller.Notifications;
using MediaBrowser.Controller.Plugins;
using System.Linq;
@@ -49,6 +50,7 @@ namespace Emby.Server.Implementations.Notifications
public void Dispose()
{
_notificationsRepo.NotificationAdded -= _notificationsRepo_NotificationAdded;
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/Session/HttpSessionController.cs b/Emby.Server.Implementations/Session/HttpSessionController.cs
index dbac76bb4..bd53da1bd 100644
--- a/Emby.Server.Implementations/Session/HttpSessionController.cs
+++ b/Emby.Server.Implementations/Session/HttpSessionController.cs
@@ -14,7 +14,7 @@ using System.Threading.Tasks;
namespace Emby.Server.Implementations.Session
{
- public class HttpSessionController : ISessionController, IDisposable
+ public class HttpSessionController : ISessionController
{
private readonly IHttpClient _httpClient;
private readonly IJsonSerializer _json;
@@ -195,9 +195,5 @@ namespace Emby.Server.Implementations.Session
return "?" + args;
}
-
- public void Dispose()
- {
- }
}
}
diff --git a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
index 2735bb237..a5af843db 100644
--- a/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
+++ b/Emby.Server.Implementations/Session/SessionWebSocketListener.cs
@@ -102,6 +102,7 @@ namespace Emby.Server.Implementations.Session
public void Dispose()
{
_serverManager.WebSocketConnected -= _serverManager_WebSocketConnected;
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/Session/WebSocketController.cs b/Emby.Server.Implementations/Session/WebSocketController.cs
index f0ff0b5dd..ee9ee8969 100644
--- a/Emby.Server.Implementations/Session/WebSocketController.cs
+++ b/Emby.Server.Implementations/Session/WebSocketController.cs
@@ -283,6 +283,7 @@ namespace Emby.Server.Implementations.Session
{
socket.Closed -= connection_Closed;
}
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/TV/SeriesPostScanTask.cs b/Emby.Server.Implementations/TV/SeriesPostScanTask.cs
index 23b6a3cb5..764df8baf 100644
--- a/Emby.Server.Implementations/TV/SeriesPostScanTask.cs
+++ b/Emby.Server.Implementations/TV/SeriesPostScanTask.cs
@@ -217,6 +217,7 @@ namespace Emby.Server.Implementations.TV
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
/// <summary>
diff --git a/Emby.Server.Implementations/Threading/CommonTimer.cs b/Emby.Server.Implementations/Threading/CommonTimer.cs
index 9451b07f3..bb67325d1 100644
--- a/Emby.Server.Implementations/Threading/CommonTimer.cs
+++ b/Emby.Server.Implementations/Threading/CommonTimer.cs
@@ -31,6 +31,7 @@ namespace Emby.Server.Implementations.Threading
public void Dispose()
{
_timer.Dispose();
+ GC.SuppressFinalize(this);
}
}
}
diff --git a/Emby.Server.Implementations/Updates/InstallationManager.cs b/Emby.Server.Implementations/Updates/InstallationManager.cs
index 75328a39a..180463040 100644
--- a/Emby.Server.Implementations/Updates/InstallationManager.cs
+++ b/Emby.Server.Implementations/Updates/InstallationManager.cs
@@ -722,6 +722,7 @@ namespace Emby.Server.Implementations.Updates
public void Dispose()
{
Dispose(true);
+ GC.SuppressFinalize(this);
}
}
}