Browse Source

Fix ref/unref problem. Was doing opposite of what I should.

v0.7.4-release
Ryan 16 years ago
parent
commit
e4ba665c87
  1. 6
      src/events.cc
  2. 4
      test/mjsunit/test-http-cat.js

6
src/events.cc

@ -86,7 +86,7 @@ Promise::Create (void)
ObjectWrap::InformV8ofAllocation(promise);
promise->Attach();
ev_unref(EV_DEFAULT_UC);
ev_ref(EV_DEFAULT_UC);
return promise;
}
@ -97,7 +97,7 @@ Promise::EmitSuccess (int argc, v8::Handle<v8::Value> argv[])
bool r = Emit("success", argc, argv);
Detach();
ev_ref(EV_DEFAULT_UC);
ev_unref(EV_DEFAULT_UC);
return r;
}
@ -108,7 +108,7 @@ Promise::EmitError (int argc, v8::Handle<v8::Value> argv[])
bool r = Emit("error", argc, argv);
Detach();
ev_ref(EV_DEFAULT_UC);
ev_unref(EV_DEFAULT_UC);
return r;
}

4
test/mjsunit/test-http-cat.js

@ -18,7 +18,7 @@ var bad_server_got_error = false;
function onLoad () {
node.http.cat("http://localhost:"+PORT+"/", "utf8")
.addCallback(function (content) {
node.debug("got response");
puts("got response");
got_good_server_content = true;
assertEquals(body, content);
server.close();
@ -26,7 +26,7 @@ function onLoad () {
node.http.cat("http://localhost:12312/", "utf8")
.addErrback(function () {
node.debug("got error (this should happen)");
puts("got error (this should happen)");
bad_server_got_error = true;
});
}

Loading…
Cancel
Save