diff --git a/src/pipe_wrap.cc b/src/pipe_wrap.cc index adbeb0f8c1..5d0c5128ed 100644 --- a/src/pipe_wrap.cc +++ b/src/pipe_wrap.cc @@ -85,6 +85,7 @@ class PipeWrap : StreamWrap { int r = uv_pipe_init(&handle_); assert(r == 0); // How do we proxy this error up to javascript? // Suggestion: uv_pipe_init() returns void. + UpdateWriteQueueSize(); } static Handle Bind(const Arguments& args) { diff --git a/src/stream_wrap.cc b/src/stream_wrap.cc index 3da51d9600..528c523bfa 100644 --- a/src/stream_wrap.cc +++ b/src/stream_wrap.cc @@ -72,12 +72,11 @@ StreamWrap::StreamWrap(Handle object, uv_stream_t* stream) : HandleWrap(object, (uv_handle_t*)stream) { stream_ = stream; stream->data = this; - - UpdateWriteQueueSize(); } void StreamWrap::UpdateWriteQueueSize() { + HandleScope scope; object_->Set(write_queue_size_sym, Integer::New(stream_->write_queue_size)); } diff --git a/src/stream_wrap.h b/src/stream_wrap.h index d1b442fa87..f3e2c462ff 100644 --- a/src/stream_wrap.h +++ b/src/stream_wrap.h @@ -21,9 +21,9 @@ class StreamWrap : public HandleWrap { StreamWrap(v8::Handle object, uv_stream_t* stream); virtual ~StreamWrap() { } void StateChange() { } + void UpdateWriteQueueSize(); private: - void UpdateWriteQueueSize(); static inline char* NewSlab(v8::Handle global, v8::Handle wrap_obj); // Callbacks for libuv diff --git a/src/tcp_wrap.cc b/src/tcp_wrap.cc index 814f7e235b..51ff966187 100644 --- a/src/tcp_wrap.cc +++ b/src/tcp_wrap.cc @@ -111,6 +111,7 @@ class TCPWrap : public StreamWrap { int r = uv_tcp_init(&handle_); assert(r == 0); // How do we proxy this error up to javascript? // Suggestion: uv_tcp_init() returns void. + UpdateWriteQueueSize(); } ~TCPWrap() {