aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Data/ManagedConnection.cs
diff options
context:
space:
mode:
authorJayson Reis <santosdosreis@gmail.com>2022-01-22 21:52:30 +0000
committerJayson Reis <santosdosreis@gmail.com>2022-01-22 21:52:30 +0000
commit2e4dd02f76ec9a8487de7e1ceb0b0871c5be766d (patch)
tree9dcc41e70cda53c35ca6cf84782c55edccf83102 /Emby.Server.Implementations/Data/ManagedConnection.cs
parentcd4587b43f9831a9529ddaed50ba4b9935fa061b (diff)
chore: Add a read only connection for routes like Shows/NextUp
Diffstat (limited to 'Emby.Server.Implementations/Data/ManagedConnection.cs')
-rw-r--r--Emby.Server.Implementations/Data/ManagedConnection.cs7
1 files changed, 4 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/Data/ManagedConnection.cs b/Emby.Server.Implementations/Data/ManagedConnection.cs
index 11e33278d..97cb6f26f 100644
--- a/Emby.Server.Implementations/Data/ManagedConnection.cs
+++ b/Emby.Server.Implementations/Data/ManagedConnection.cs
@@ -9,11 +9,12 @@ namespace Emby.Server.Implementations.Data
{
public sealed class ManagedConnection : IDisposable
{
- private readonly SemaphoreSlim _writeLock;
+ private readonly SemaphoreSlim? _writeLock;
private SQLiteDatabaseConnection? _db;
- private bool _disposed = false;
+ private bool _disposed;
+
public ManagedConnection(SQLiteDatabaseConnection db, SemaphoreSlim writeLock)
{
@@ -73,7 +74,7 @@ namespace Emby.Server.Implementations.Data
return;
}
- _writeLock.Release();
+ _writeLock?.Release();
_db = null; // Don't dispose it
_disposed = true;