summaryrefslogtreecommitdiffstats
path: root/Modules
diff options
context:
space:
mode:
authorBenjamin Peterson <benjamin@python.org>2011-06-01 02:31:37 (GMT)
committerBenjamin Peterson <benjamin@python.org>2011-06-01 02:31:37 (GMT)
commit5c2b09e856555e34128113ac99758a776f66ce3c (patch)
tree82f2c50968fbff3b82d166e923046deb728906b6 /Modules
parent2e3a38a77468661f19d228977aa8fa2616d14a6a (diff)
downloadcpython-5c2b09e856555e34128113ac99758a776f66ce3c.zip
cpython-5c2b09e856555e34128113ac99758a776f66ce3c.tar.gz
cpython-5c2b09e856555e34128113ac99758a776f66ce3c.tar.bz2
be extra careful with a borrowed reference when the GIL could be released (closes #8578)
Diffstat (limited to 'Modules')
-rw-r--r--Modules/_sqlite/connection.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/Modules/_sqlite/connection.c b/Modules/_sqlite/connection.c
index e4969e3..7d12d5e 100644
--- a/Modules/_sqlite/connection.c
+++ b/Modules/_sqlite/connection.c
@@ -200,11 +200,13 @@ void pysqlite_do_all_statements(pysqlite_Connection* self, int action, int reset
weakref = PyList_GetItem(self->statements, i);
statement = PyWeakref_GetObject(weakref);
if (statement != Py_None) {
+ Py_INCREF(statement);
if (action == ACTION_RESET) {
(void)pysqlite_statement_reset((pysqlite_Statement*)statement);
} else {
(void)pysqlite_statement_finalize((pysqlite_Statement*)statement);
}
+ Py_DECREF(statement);
}
}