mirror of
https://github.com/moodle/moodle.git
synced 2025-03-21 16:10:15 +01:00
If there is a PHP fatal error and destructors do not run (this can happen in out-of-memory errors, and maybe if there is an error in a previous destructor) then Postgres cursors may be left open. Usually this does not cause a problem because the connection is closed anyway, but if using persistent connections, a future request may reuse the connection with a cursor open. It then gets errors when it tries to create a new cursor with the same name. This change closes all cursors at the start of a persistent connection.