Skip to content

Commit

Permalink
Destroy lua state before exiting couchscript
Browse files Browse the repository at this point in the history
couchscript currently exits without destroying the lua
state which means both the lua state and any objects
within it that have not been garbage collected are
technically leaked and caught by valgrind. This change
ensures that the lua state is destroyed before exiting.

Change-Id: I795d439dccb171899463d0d1122865be8ec1f1f0
Reviewed-on: http://review.couchbase.org/61928
Tested-by: buildbot <build@couchbase.com>
Reviewed-by: Dave Rigby <daver@couchbase.com>
  • Loading branch information
Chippiewill authored and daverigby committed Mar 31, 2016
1 parent 236dd13 commit 9e90a38
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/couchscript.cc
Original file line number Diff line number Diff line change
Expand Up @@ -863,5 +863,6 @@ int main(int argc, char **argv)
if (top && lua_isnumber(ls, top)) {
rc = static_cast<int>(lua_tonumber(ls, top));
}
lua_close(ls);
return rc;
}

0 comments on commit 9e90a38

Please sign in to comment.