]> git.smokeofanarchy.ru Git - space-station-14.git/commitdiff
Fix server crash on shutdown due to DB notifications (#31379)
authorPieter-Jan Briers <pieterjan.briers+git@gmail.com>
Fri, 23 Aug 2024 23:45:13 +0000 (01:45 +0200)
committerGitHub <noreply@github.com>
Fri, 23 Aug 2024 23:45:13 +0000 (01:45 +0200)
Fixes #31365

Content.Server/Database/ServerDbPostgres.Notifications.cs

index fe358923bf0b087332af64d5c82e62cd483012a5..69cf2c7d775d529835adaec2caeea4f5d37c3148 100644 (file)
@@ -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();
     }
 }