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.
This commit is contained in:
Andrew Nicols
2025-11-25 15:27:39 +00:00
committed by Paul Holden
parent 5e655ad805
commit 382b5982a6
+1
View File
@@ -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'));