[Python-checkins] python/dist/src/Modules _bsddb.c,1.16,1.17
loewis@users.sourceforge.net
loewis@users.sourceforge.net
Tue, 15 Jul 2003 12:12:56 -0700
Update of /cvsroot/python/python/dist/src/Modules
In directory sc8-pr-cvs1:/tmp/cvs-serv18854/Modules
Modified Files:
_bsddb.c
Log Message:
heck environment closed status before closing a cursors. Fixes #763928.
Index: _bsddb.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_bsddb.c,v
retrieving revision 1.16
retrieving revision 1.17
diff -C2 -d -r1.16 -r1.17
*** _bsddb.c 9 Jul 2003 04:45:59 -0000 1.16
--- _bsddb.c 15 Jul 2003 19:12:54 -0000 1.17
***************
*** 775,779 ****
if (self->dbc != NULL) {
MYDB_BEGIN_ALLOW_THREADS;
! if (self->mydb->db != NULL)
err = self->dbc->c_close(self->dbc);
self->dbc = NULL;
--- 775,786 ----
if (self->dbc != NULL) {
MYDB_BEGIN_ALLOW_THREADS;
! /* If the underlying database has been closed, we don't
! need to do anything. If the environment has been closed
! we need to leak, as BerkeleyDB will crash trying to access
! the environment. There was an exception when the
! user closed the environment even though there still was
! a database open. */
! if (self->mydb->db && self->mydb->myenvobj &&
! !self->mydb->myenvobj->closed)
err = self->dbc->c_close(self->dbc);
self->dbc = NULL;