mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
add proper rs_close() into cleanup_contexts() - we have to close even when now records returned
This commit is contained in:
parent
77be46fdee
commit
3f7d592598
1 changed files with 14 additions and 12 deletions
|
@ -2442,7 +2442,7 @@ function cleanup_contexts() {
|
|||
ON c.instanceid = t.id
|
||||
WHERE t.id IS NULL AND c.contextlevel = " . CONTEXT_GROUP . "
|
||||
";
|
||||
$rs = get_recordset_sql($sql);
|
||||
if ($rs = get_recordset_sql($sql)) {
|
||||
if ($rs->RecordCount()) {
|
||||
begin_sql();
|
||||
$tx = true;
|
||||
|
@ -2457,6 +2457,8 @@ function cleanup_contexts() {
|
|||
rollback_sql();
|
||||
return false;
|
||||
}
|
||||
rs_close($rs);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue