Skip to content

Commit

Permalink
Address valgrind warnings to properly initializer lastReaderCheck and…
Browse files Browse the repository at this point in the history
… delete the open envs vector, #300
  • Loading branch information
kriszyp committed Aug 20, 2024
1 parent cab47a5 commit 9289b4d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/env.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static napi_ref testRef;
static napi_env testRefEnv;
void EnvWrap::cleanupEnvWraps(void* data) {
if (openEnvWraps)
free(openEnvWraps);
delete openEnvWraps;
else
fprintf(stderr, "How do we end up cleanup env wraps that don't exist?\n");
openEnvWraps = nullptr;
Expand All @@ -59,6 +59,7 @@ EnvWrap::EnvWrap(const CallbackInfo& info) : ObjectWrap<EnvWrap>(info) {
this->writeWorker = nullptr;
this->readTxnRenewed = false;
this->hasWrites = false;
this->lastReaderCheck = 0;
this->writingLock = new pthread_mutex_t;
this->writingCond = new pthread_cond_t;
info.This().As<Object>().Set("address", Number::New(info.Env(), (size_t) this));
Expand Down

0 comments on commit 9289b4d

Please sign in to comment.