Skip to content

Commit

Permalink
Wrap term_to_js and js_to_term into v8::Locker to avoid conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
yrashk committed Mar 22, 2011
1 parent 5866929 commit 349be72
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions c_src/erlv8_term.cc
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ v8::Handle<v8::Object> externalize_term(map<ERL_NIF_TERM, v8::Handle<v8::Object>
}

v8::Handle<v8::Value> term_to_js(ErlNifEnv *env, ERL_NIF_TERM term) {
v8::Locker locker;
v8::HandleScope handle_scope;
int _int; unsigned int _uint; long _long; unsigned long _ulong; ErlNifSInt64 _int64; ErlNifUInt64 _uint64; double _double;
ErlNifBinary string_binary;
Expand Down Expand Up @@ -264,6 +265,7 @@ v8::Handle<v8::Value> term_to_js(ErlNifEnv *env, ERL_NIF_TERM term) {


ERL_NIF_TERM js_to_term(ErlNifEnv *env, v8::Handle<v8::Value> val) {
v8::Locker locker;
v8::HandleScope handle_scope;
if (val.IsEmpty()) {
return enif_make_atom(env,"undefined");
Expand Down

0 comments on commit 349be72

Please sign in to comment.