Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Further result allocationf fix

  • Loading branch information...
commit 3bcc6720cd73a2386a5e5abffd8c4735ff3676e5 1 parent 866687a
@yrashk yrashk authored
Showing with 4 additions and 3 deletions.
  1. +3 −2 c_src/erlv8.cc
  2. +1 −1  c_src/erlv8_result.cc
View
5 c_src/erlv8.cc
@@ -106,6 +106,8 @@ VM::~VM() {
};
void VM::run() {
+ v8::Locker locker;
+ v8::HandleScope handle_scope; // the very top level handle scope
ticker(0);
};
@@ -130,8 +132,6 @@ v8::Handle<v8::Value> VM::ticker(ERL_NIF_TERM ref0) {
Tick tick_s;
ERL_NIF_TERM tick, tick_ref;
while (1) {
- LHCS(context);
-
{
v8::Unlocker unlocker;
zmq_msg_init (&msg);
@@ -163,6 +163,7 @@ v8::Handle<v8::Value> VM::ticker(ERL_NIF_TERM ref0) {
if ((!tick_handlers[i].name) ||
(!strcmp(name,tick_handlers[i].name))) { // handler has been located
TickHandlerResolution resolution = (tick_handlers[i].handler(this, name, tick, tick_ref, ref, arity, array));
+
switch (resolution.type) {
case DONE:
stop_flag = true;
View
2  c_src/erlv8_result.cc
@@ -6,7 +6,7 @@ TickHandler(ResultTickHandler) {
if (((unsigned long) ref) &&
(enif_is_identical(array[1],ref))) { // this is our result
- result.value = term_to_js(vm->context,vm->env,array[2]);
+ result.value = handle_scope.Close(term_to_js(vm->context,vm->env,array[2]));
result.type = RETURN;
return result;
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.