This was causing controller references not cleaned till gc
and loggers to remain open, leading to problems under windows.
throw new \moodle_exception('Failed to backup activity prior to deletion.');
}
+ // Have finished with the controller, let's destroy it, freeing mem and resources.
+ $controller->destroy();
+
// Grab the filename.
$file = $result['backup_destination'];
if (!$file->get_contenthash()) {
// Run the import.
$controller->execute_plan();
+ // Have finished with the controller, let's destroy it, freeing mem and resources.
+ $controller->destroy();
+
// Fire event.
$event = \tool_recyclebin\event\category_bin_item_restored::create(array(
'objectid' => $item->id,
throw new \moodle_exception('Failed to backup activity prior to deletion.');
}
+ // Have finished with the controller, let's destroy it, freeing mem and resources.
+ $controller->destroy();
+
// Grab the filename.
$file = $result['backup_destination'];
if (!$file->get_contenthash()) {
// Run the import.
$controller->execute_plan();
+ // Have finished with the controller, let's destroy it, freeing mem and resources.
+ $controller->destroy();
+
// Fire event.
$event = \tool_recyclebin\event\course_bin_item_restored::create(array(
'objectid' => $item->id,