Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
js_stream: fix leak of instances
Don't forget to call `MakeWeak` to ensure that instance objects are
garbage collectable.
  • Loading branch information
indutny committed Mar 6, 2015
commit 6866719a4e9000dd31cd561ffc323675ad345fa0
1 change: 1 addition & 0 deletions src/js_stream.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ JSStream::JSStream(Environment* env, Handle<Object> obj, AsyncWrap* parent)
: StreamBase(env),
AsyncWrap(env, obj, AsyncWrap::PROVIDER_JSSTREAM, parent) {
node::Wrap(obj, this);
MakeWeak<JSStream>(this);
}


Expand Down
3 changes: 2 additions & 1 deletion src/js_stream.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ class JSStream : public StreamBase, public AsyncWrap {
v8::Handle<v8::Value> unused,
v8::Handle<v8::Context> context);

~JSStream();

void* Cast() override;
bool IsAlive() override;
bool IsClosing() override;
Expand All @@ -28,7 +30,6 @@ class JSStream : public StreamBase, public AsyncWrap {

protected:
JSStream(Environment* env, v8::Handle<v8::Object> obj, AsyncWrap* parent);
~JSStream();

AsyncWrap* GetAsyncWrap() override;

Expand Down