Commit 350d12a3 authored by Rich Prohaska's avatar Rich Prohaska

close and delete private DbEnv after the Db is closed. closes #233

git-svn-id: file:///svn/tokudb@1412 c7de825b-a66e-492c-adef-691d508d4ae1
parent a0209525
......@@ -27,14 +27,14 @@ Db::Db(DbEnv *env, u_int32_t flags)
}
Db::~Db() {
if (is_private_env && the_Env) {
the_Env->close(0);
delete the_Env;
}
if (the_db) {
close(0); // the user should have called close, but we do it here if not done.
assert(the_db==0);
}
if (is_private_env && the_Env) {
the_Env->close(0);
delete the_Env;
}
}
int Db::close (u_int32_t flags) {
......
......@@ -31,3 +31,4 @@ check: $(TARGETS)
$(VGRIND) ./db_dump_e foo.db > foo.out
diff foo.out foo.expectout
$(VGRIND) ./exceptions
$(VGRIND) ./test_no_env
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment