From 15977579e2fc43ea1c86d57c9e3fcc0b868925ff Mon Sep 17 00:00:00 2001 From: Frank Celler Date: Mon, 23 Apr 2012 10:38:29 +0200 Subject: [PATCH] fixed missing release --- V8/v8-vocbase.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/V8/v8-vocbase.cpp b/V8/v8-vocbase.cpp index 76d416e1e9..1b610679d9 100644 --- a/V8/v8-vocbase.cpp +++ b/V8/v8-vocbase.cpp @@ -540,6 +540,8 @@ static v8::Handle EnsureHashSkipListIndex (string const& cmd, } TRI_DestroyVector(&attributes); + + ReleaseCollection(collection); return scope.Close(v8::ThrowException(CreateErrorObject(res, errorString))); } @@ -584,6 +586,7 @@ static v8::Handle EnsureHashSkipListIndex (string const& cmd, TRI_json_t* json = idx->json(idx, collection->_collection); if (!json) { + ReleaseCollection(collection); return scope.Close(v8::ThrowException(v8::String::New("out of memory"))); } @@ -1259,6 +1262,7 @@ static v8::Handle EdgesQuery (TRI_edge_direction_e direction, v8::Arg ReleaseCollection(vertexCollection); } + ReleaseCollection(collection); return scope.Close(v8::ThrowException(errMsg)); } @@ -1866,8 +1870,6 @@ static v8::Handle JS_ByExampleQuery (v8::Arguments const& argv) { // outside a write transaction // ............................................................................. - ReleaseCollection(collection); - // free for (size_t j = 0; j < n; ++j) { TRI_FreeShapedJson(values[j]); @@ -1876,6 +1878,7 @@ static v8::Handle JS_ByExampleQuery (v8::Arguments const& argv) { TRI_Free(values); TRI_Free(pids); + ReleaseCollection(collection); return scope.Close(result); }