HandleScope scope;
TCPWrap* wrap = static_cast<TCPWrap*>(handle->data);
-
assert(&wrap->handle_ == (uv_tcp_t*)handle);
+ // We should not be getting this callback if someone as already called
+ // uv_close() on the handle. Since we've destroyed object_ at the same
+ // time as calling uv_close() we can test for this here.
+ assert(wrap->object_.IsEmpty() == false);
+
if (status != 0) {
// TODO Handle server error (call onerror?)
assert(0);
TCPWrap* wrap = static_cast<TCPWrap*>(handle->data);
+ // We should not be getting this callback if someone as already called
+ // uv_close() on the handle. Since we've destroyed object_ at the same
+ // time as calling uv_close() we can test for this here.
+ assert(wrap->object_.IsEmpty() == false);
+
// Remove the reference to the slab to avoid memory leaks;
Local<Value> slab_v = wrap->object_->GetHiddenValue(slab_sym);
wrap->object_->SetHiddenValue(slab_sym, v8::Null());
HandleScope scope;
+ // The request object should still be there.
+ assert(req_wrap->object_.IsEmpty() == false);
+
if (status) {
SetErrno(uv_last_error().code);
}
HandleScope scope;
+ // The request object should still be there.
+ assert(req_wrap->object_.IsEmpty() == false);
+
if (status) {
SetErrno(uv_last_error().code);
}
ReqWrap* req_wrap = (ReqWrap*) req->data;
TCPWrap* wrap = (TCPWrap*) req->handle->data;
+ // The request object should still be there.
+ assert(req_wrap->object_.IsEmpty() == false);
+
HandleScope scope;
if (status) {