From 382b5982a61ae22b0f6f2d7ccd237dda70d65f94 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 399cd82144e..65ce9db4fdb 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'));