Skip to content

Commit

Permalink
Properly lock the V8 engine when cleaning up resources
Browse files Browse the repository at this point in the history
  • Loading branch information
evax committed Mar 24, 2011
1 parent 246177b commit 7443cc8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions c_src/erlv8.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,12 +406,14 @@ static void vm_resource_destroy(ErlNifEnv* env, void* obj) {
};

static void val_resource_destroy(ErlNifEnv* env, void* obj) {
v8::Locker locker;
val_res_t * res = reinterpret_cast<val_res_t *>(obj);
res->ctx.Dispose();
res->val.Dispose();
};

static void ctx_resource_destroy(ErlNifEnv* env, void* obj) {
v8::Locker locker;
ctx_res_t * res = reinterpret_cast<ctx_res_t *>(obj);
res->ctx.Dispose();
};
Expand Down

0 comments on commit 7443cc8

Please sign in to comment.