Skip to content

Commit

Permalink
Fix memory leak by deleting ring->vpoints pointer
Browse files Browse the repository at this point in the history
  • Loading branch information
wdavidw committed Apr 23, 2011
1 parent f0251dc commit 760d0dc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hash_ring.cc
Expand Up @@ -91,6 +91,10 @@ HashRing::HashRing(Local<Object> weight_hash) : ObjectWrap() {
ring.num_points = vpoint_idx;
}

HashRing::~HashRing(){
delete [] ring.vpoints;
}

Handle<Value> HashRing::New(const Arguments &args) {
HandleScope scope;

Expand Down
1 change: 1 addition & 0 deletions src/hash_ring.h
Expand Up @@ -27,6 +27,7 @@ class HashRing : public node::ObjectWrap {

public:
HashRing(v8::Local<v8::Object> weight_hash);
~HashRing();

static void Initialize(v8::Handle<v8::Object> target);

Expand Down

0 comments on commit 760d0dc

Please sign in to comment.