From: Pieter-Jan Briers Date: Fri, 23 Aug 2024 23:45:13 +0000 (+0200) Subject: Fix server crash on shutdown due to DB notifications (#31379) X-Git-Url: https://git.smokeofanarchy.ru/gitweb.cgi?a=commitdiff_plain;h=b396996af88b19014ff90a440bdee06c147288b8;p=space-station-14.git Fix server crash on shutdown due to DB notifications (#31379) Fixes #31365 --- diff --git a/Content.Server/Database/ServerDbPostgres.Notifications.cs b/Content.Server/Database/ServerDbPostgres.Notifications.cs index fe358923bf..69cf2c7d77 100644 --- a/Content.Server/Database/ServerDbPostgres.Notifications.cs +++ b/Content.Server/Database/ServerDbPostgres.Notifications.cs @@ -97,6 +97,8 @@ public sealed partial class ServerDbPostgres _notifyLog.Error($"Error in notification listener: {e}"); } } + + _notificationConnection.Dispose(); } private void OnNotification(object _, NpgsqlNotificationEventArgs notification) @@ -116,6 +118,5 @@ public sealed partial class ServerDbPostgres return; _notificationConnection.Notification -= OnNotification; - _notificationConnection.Dispose(); } }