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.
This commit is contained in:
parent
f0b5d174c1
commit
f655dff807
|
@ -1135,9 +1135,7 @@ DB_close(DBObject* self, PyObject* args)
|
||||||
if (self->db != NULL) {
|
if (self->db != NULL) {
|
||||||
if (self->myenvobj)
|
if (self->myenvobj)
|
||||||
CHECK_ENV_NOT_CLOSED(self->myenvobj);
|
CHECK_ENV_NOT_CLOSED(self->myenvobj);
|
||||||
MYDB_BEGIN_ALLOW_THREADS;
|
|
||||||
err = self->db->close(self->db, flags);
|
err = self->db->close(self->db, flags);
|
||||||
MYDB_END_ALLOW_THREADS;
|
|
||||||
self->db = NULL;
|
self->db = NULL;
|
||||||
RETURN_IF_ERR();
|
RETURN_IF_ERR();
|
||||||
}
|
}
|
||||||
|
@ -1707,9 +1705,8 @@ DB_remove(DBObject* self, PyObject* args, PyObject* kwargs)
|
||||||
return NULL;
|
return NULL;
|
||||||
CHECK_DB_NOT_CLOSED(self);
|
CHECK_DB_NOT_CLOSED(self);
|
||||||
|
|
||||||
MYDB_BEGIN_ALLOW_THREADS;
|
|
||||||
err = self->db->remove(self->db, filename, database, flags);
|
err = self->db->remove(self->db, filename, database, flags);
|
||||||
MYDB_END_ALLOW_THREADS;
|
self->db = NULL;
|
||||||
RETURN_IF_ERR();
|
RETURN_IF_ERR();
|
||||||
RETURN_NONE();
|
RETURN_NONE();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue