aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/Session
diff options
context:
space:
mode:
authorJPVenson <JPVenson@users.noreply.github.com>2024-01-14 16:50:09 +0100
committerGitHub <noreply@github.com>2024-01-14 16:50:09 +0100
commit3ce16713dd013b5aabdedebafd025f2224d2475f (patch)
treec3b649dc06f4e898ea4984dee44a2d96c420e106 /Emby.Server.Implementations/Session
parentd40224128c031e38054090e063247b9a06e46f6d (diff)
Fixed disposable not being called (#10613)
* Fixed disposable not being called * PulledUp usage of IAsyncDisposable for sessioninfo Co-authored-by: Patrick Barron <barronpm@gmail.com>
Diffstat (limited to 'Emby.Server.Implementations/Session')
-rw-r--r--Emby.Server.Implementations/Session/SessionManager.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Emby.Server.Implementations/Session/SessionManager.cs b/Emby.Server.Implementations/Session/SessionManager.cs
index 6f599e4c7..f457a78b3 100644
--- a/Emby.Server.Implementations/Session/SessionManager.cs
+++ b/Emby.Server.Implementations/Session/SessionManager.cs
@@ -189,7 +189,7 @@ namespace Emby.Server.Implementations.Session
_logger);
}
- private void OnSessionEnded(SessionInfo info)
+ private async ValueTask OnSessionEnded(SessionInfo info)
{
EventHelper.QueueEventIfNotNull(
SessionEnded,
@@ -202,7 +202,7 @@ namespace Emby.Server.Implementations.Session
_eventManager.Publish(new SessionEndedEventArgs(info));
- info.Dispose();
+ await info.DisposeAsync().ConfigureAwait(false);
}
/// <inheritdoc />
@@ -301,12 +301,12 @@ namespace Emby.Server.Implementations.Session
await _mediaSourceManager.CloseLiveStream(session.PlayState.LiveStreamId).ConfigureAwait(false);
}
- OnSessionEnded(session);
+ await OnSessionEnded(session).ConfigureAwait(false);
}
}
/// <inheritdoc />
- public void ReportSessionEnded(string sessionId)
+ public async ValueTask ReportSessionEnded(string sessionId)
{
CheckDisposed();
var session = GetSession(sessionId, false);
@@ -317,7 +317,7 @@ namespace Emby.Server.Implementations.Session
_activeConnections.TryRemove(key, out _);
- OnSessionEnded(session);
+ await OnSessionEnded(session).ConfigureAwait(false);
}
}
@@ -1590,7 +1590,7 @@ namespace Emby.Server.Implementations.Session
{
try
{
- ReportSessionEnded(session.Id);
+ await ReportSessionEnded(session.Id).ConfigureAwait(false);
}
catch (Exception ex)
{