adding system check for address parsing
[civicrm-core.git] / CRM / Utils / System.php
index b68356c0e587cb2bfc93d4decc6c25999080f91a..a253b091c047da1afb7db6ade020221cbc73312d 100644 (file)
@@ -1404,6 +1404,14 @@ class CRM_Utils_System {
     // move things to CiviCRM cache as needed
     CRM_Core_Session::storeSessionObjects();
 
+    if (Civi\Core\Container::isContainerBooted()) {
+      Civi::dispatcher()->dispatch('civi.core.exit');
+    }
+
+    $userSystem = CRM_Core_Config::singleton()->userSystem;
+    if (is_callable(array($userSystem, 'onCiviExit'))) {
+      $userSystem->onCiviExit();
+    }
     exit($status);
   }