8000 Fix revwalk memory leaks by srajko · Pull Request #1137 · nodegit/nodegit · GitHub
[go: up one dir, main page]

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 1 addition & 3 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2100,6 +2100,7 @@
"ignore": true
},
"revwalk": {
"selfFreeing": true,
"dependencies": [
"../include/commit.h",
"../include/functions/copy.h"
Expand All @@ -2108,9 +2109,6 @@
"git_revwalk_add_hide_cb": {
"ignore": true
},
"git_revwalk_free": {
"ignore": true
},
"git_revwalk_new": {
"isAsync": false
}
Expand Down
10 changes: 10 additions & 0 deletions test/tests/revwalk.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ var fse = promisify(require("fs-extra"));
var path = require("path");
var local = path.join.bind(path, __dirname);

var leakTest = require("../utils/leak_test");

describe("Revwalk", function() {
var NodeGit = require("../../");
var Repository = NodeGit.Repository;
Expand Down Expand Up @@ -309,6 +311,14 @@ describe("Revwalk", function() {
});
});

it("does not leak", function() {
var test = this;

return leakTest(NodeGit.Revwalk, function() {
return Promise.resolve(NodeGit.Revwalk.create(test.repository));
});
});

// This test requires forcing garbage collection, so mocha needs to be run
// via node rather than npm, with a la `node --expose-gc [pathtohmoca]
// [testglob]`
Expand Down
0