jesus.cea
2008-09-03 17:50:59 UTC
Author: jesus.cea
Date: Wed Sep 3 19:50:59 2008
New Revision: 66183
Log:
Fix some leaks - Neal Norwitz
Modified:
python/branches/py3k/Modules/_bsddb.c
python/branches/py3k/Modules/bsddb.h
Modified: python/branches/py3k/Modules/_bsddb.c
==============================================================================
--- python/branches/py3k/Modules/_bsddb.c (original)
+++ python/branches/py3k/Modules/_bsddb.c Wed Sep 3 19:50:59 2008
@@ -1106,7 +1106,7 @@
{
PyObject *dummy;
- if (self->db_env && !self->closed) {
+ if (self->db_env) {
dummy=DBEnv_close_internal(self,0);
Py_XDECREF(dummy);
}
@@ -3981,13 +3981,15 @@
dummy=DB_close_internal(self->children_dbs,0);
Py_XDECREF(dummy);
}
+ }
+ self->closed = 1;
+ if (self->db_env) {
MYDB_BEGIN_ALLOW_THREADS;
err = self->db_env->close(self->db_env, flags);
MYDB_END_ALLOW_THREADS;
/* after calling DBEnv->close, regardless of error, this DBEnv
* may not be accessed again (Berkeley DB docs). */
- self->closed = 1;
self->db_env = NULL;
RETURN_IF_ERR();
}
@@ -6148,7 +6150,7 @@
err = self->sequence->open(self->sequence, txn, &key, flags);
MYDB_END_ALLOW_THREADS
- CLEAR_DBT(key);
+ FREE_DBT(key);
RETURN_IF_ERR();
if (txn) {
Modified: python/branches/py3k/Modules/bsddb.h
==============================================================================
--- python/branches/py3k/Modules/bsddb.h (original)
+++ python/branches/py3k/Modules/bsddb.h Wed Sep 3 19:50:59 2008
@@ -105,7 +105,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
-#define PY_BSDDB_VERSION "4.7.3pre3"
+#define PY_BSDDB_VERSION "4.7.3pre4"
/* Python object definitions */
Date: Wed Sep 3 19:50:59 2008
New Revision: 66183
Log:
Fix some leaks - Neal Norwitz
Modified:
python/branches/py3k/Modules/_bsddb.c
python/branches/py3k/Modules/bsddb.h
Modified: python/branches/py3k/Modules/_bsddb.c
==============================================================================
--- python/branches/py3k/Modules/_bsddb.c (original)
+++ python/branches/py3k/Modules/_bsddb.c Wed Sep 3 19:50:59 2008
@@ -1106,7 +1106,7 @@
{
PyObject *dummy;
- if (self->db_env && !self->closed) {
+ if (self->db_env) {
dummy=DBEnv_close_internal(self,0);
Py_XDECREF(dummy);
}
@@ -3981,13 +3981,15 @@
dummy=DB_close_internal(self->children_dbs,0);
Py_XDECREF(dummy);
}
+ }
+ self->closed = 1;
+ if (self->db_env) {
MYDB_BEGIN_ALLOW_THREADS;
err = self->db_env->close(self->db_env, flags);
MYDB_END_ALLOW_THREADS;
/* after calling DBEnv->close, regardless of error, this DBEnv
* may not be accessed again (Berkeley DB docs). */
- self->closed = 1;
self->db_env = NULL;
RETURN_IF_ERR();
}
@@ -6148,7 +6150,7 @@
err = self->sequence->open(self->sequence, txn, &key, flags);
MYDB_END_ALLOW_THREADS
- CLEAR_DBT(key);
+ FREE_DBT(key);
RETURN_IF_ERR();
if (txn) {
Modified: python/branches/py3k/Modules/bsddb.h
==============================================================================
--- python/branches/py3k/Modules/bsddb.h (original)
+++ python/branches/py3k/Modules/bsddb.h Wed Sep 3 19:50:59 2008
@@ -105,7 +105,7 @@
#error "eek! DBVER can't handle minor versions > 9"
#endif
-#define PY_BSDDB_VERSION "4.7.3pre3"
+#define PY_BSDDB_VERSION "4.7.3pre4"
/* Python object definitions */