* Don't crash when upgrading the Berkeley DB environment.

This commit is contained in:
Eelco Dolstra 2006-10-13 11:15:53 +00:00
parent 2a535689fe
commit e4af398681

View file

@ -30,7 +30,12 @@ class DestroyDbEnv
DbEnv * dbenv;
public:
DestroyDbEnv(DbEnv * _dbenv) : dbenv(_dbenv) { }
~DestroyDbEnv() { if (dbenv) { dbenv->close(0); delete dbenv; } }
~DestroyDbEnv() {
if (dbenv) {
if (dbenv->get_DB_ENV()) dbenv->close(0);
delete dbenv;
}
}
void release() { dbenv = 0; };
};