Issue32274
Created on 2017-12-11 09:41 by lelit, last changed 2022-04-11 14:58 by admin. This issue is now closed.
| Messages (3) | |||
|---|---|---|---|
| msg308021 - (view) | Author: Lele Gaifax (lelit) * | Date: 2017-12-11 09:41 | |
The function calls ``sqlite3_open()`` that, if I understand its documentation correctly[#], returns a new connection object in all cases (that is, even on errors) with the only exception of "out of memory" (in which case it sets the second parameter to ``NULL``). I think that the new connection object should be immediately released in case of errors, passing it to ``sqlite3_close()``. .. [#] http://sqlite.org/c3ref/open.html |
|||
| msg308024 - (view) | Author: Julien Palard (mdk) * ![]() |
Date: 2017-12-11 10:35 | |
I don't see a leak here: as long as nobody keep a reference to each connection objects, pysqlite_connection_dealloc will be called and will call the sqlite3_close. In other words the sqlite3_close is called when the connection is destroyed, which happen when no reference are kept on the connection, indifferently of a success or a failure of the connection. It's in Modules/_sqlite/connection.c |
|||
| msg308025 - (view) | Author: Lele Gaifax (lelit) * | Date: 2017-12-11 10:43 | |
You are right, thank you. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:58:55 | admin | set | github: 76455 |
| 2017-12-11 10:43:28 | lelit | set | status: open -> closed resolution: not a bug messages: + msg308025 stage: resolved |
| 2017-12-11 10:35:31 | mdk | set | nosy:
+ mdk messages: + msg308024 |
| 2017-12-11 09:41:13 | lelit | create | |
