This commit is contained in:
Jun Pataleta 2023-04-19 23:45:25 +08:00
commit ad37980aeb

View File

@ -64,6 +64,13 @@ class activity_packager {
);
}
/**
* Destructor
*/
public function __destruct() {
$this->controller->destroy();
}
/**
* Prepare the backup file using appropriate setting overrides and return relevant information.
*
@ -131,8 +138,6 @@ class activity_packager {
// Execute the backup and fetch the result.
$this->controller->execute_plan();
$result = $this->controller->get_results();
// Controller no longer required.
$this->controller->destroy();
if (!isset($result['backup_destination'])) {
throw new \moodle_exception('Failed to package activity.');