Skip to content

Commit 9289b4d

Browse files
committed
Address valgrind warnings to properly initializer lastReaderCheck and delete the open envs vector, #300
1 parent cab47a5 commit 9289b4d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/env.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static napi_ref testRef;
3838
static napi_env testRefEnv;
3939
void EnvWrap::cleanupEnvWraps(void* data) {
4040
if (openEnvWraps)
41-
free(openEnvWraps);
41+
delete openEnvWraps;
4242
else
4343
fprintf(stderr, "How do we end up cleanup env wraps that don't exist?\n");
4444
openEnvWraps = nullptr;
@@ -59,6 +59,7 @@ EnvWrap::EnvWrap(const CallbackInfo& info) : ObjectWrap<EnvWrap>(info) {
5959
this->writeWorker = nullptr;
6060
this->readTxnRenewed = false;
6161
this->hasWrites = false;
62+
this->lastReaderCheck = 0;
6263
this->writingLock = new pthread_mutex_t;
6364
this->writingCond = new pthread_cond_t;
6465
info.This().As<Object>().Set("address", Number::New(info.Env(), (size_t) this));

0 commit comments

Comments
 (0)