diff options
author | Gregory P. Smith <greg@mad-scientist.com> | 2003-05-15 00:13:18 (GMT) |
---|---|---|
committer | Gregory P. Smith <greg@mad-scientist.com> | 2003-05-15 00:13:18 (GMT) |
commit | f655dff80782cd6bf59d64985299bd07546cb98b (patch) | |
tree | 6b669835b8531ad418c7478e322fc4caf7602fe0 /Modules/_bsddb.c | |
parent | f0b5d174c130c3710bae7860ec005bdb8e7ac3dd (diff) | |
download | cpython-f655dff80782cd6bf59d64985299bd07546cb98b.zip cpython-f655dff80782cd6bf59d64985299bd07546cb98b.tar.gz cpython-f655dff80782cd6bf59d64985299bd07546cb98b.tar.bz2 |
DB.remove() needs to set the internal DB handle to NULL after being called.
(sourceforge pybsddb bug #737970).
Also: don't allow other threads to run during calls that invalidate the
DB handle.
Diffstat (limited to 'Modules/_bsddb.c')
-rw-r--r-- | Modules/_bsddb.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/Modules/_bsddb.c b/Modules/_bsddb.c index eb2b516..7a4f9e1 100644 --- a/Modules/_bsddb.c +++ b/Modules/_bsddb.c @@ -1135,9 +1135,7 @@ DB_close(DBObject* self, PyObject* args) if (self->db != NULL) { if (self->myenvobj) CHECK_ENV_NOT_CLOSED(self->myenvobj); - MYDB_BEGIN_ALLOW_THREADS; err = self->db->close(self->db, flags); - MYDB_END_ALLOW_THREADS; self->db = NULL; RETURN_IF_ERR(); } @@ -1707,9 +1705,8 @@ DB_remove(DBObject* self, PyObject* args, PyObject* kwargs) return NULL; CHECK_DB_NOT_CLOSED(self); - MYDB_BEGIN_ALLOW_THREADS; err = self->db->remove(self->db, filename, database, flags); - MYDB_END_ALLOW_THREADS; + self->db = NULL; RETURN_IF_ERR(); RETURN_NONE(); } |