From ab6a201b2c2e2fa59d1983ebb6d957e5d41fdf22 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Mon, 1 Sep 2025 10:00:13 +0200 Subject: [PATCH] MDL-87046 core: Fix shutdown manager early return If the `\core_shutdown_manager::initialize` method is called multiple times, it should only succeed once. Unfortunately whilst logging existed, the shutdown manager did not actually exit. --- lib/classes/shutdown_manager.php | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/classes/shutdown_manager.php b/lib/classes/shutdown_manager.php index 202006c2754..d9072bf5ea2 100644 --- a/lib/classes/shutdown_manager.php +++ b/lib/classes/shutdown_manager.php @@ -50,6 +50,7 @@ class core_shutdown_manager { public static function initialize() { if (self::$registered) { debugging('Shutdown manager is already initialised!'); + return; } self::$registered = true; register_shutdown_function(array('core_shutdown_manager', 'shutdown_handler'));