Skip to content

Commit ded20af

Browse files
committed
fix m-alloc error
1 parent 3706b2a commit ded20af

7 files changed

Lines changed: 13 additions & 6 deletions

File tree

generate/templates/class_content.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ extern "C" {
99
{%endeach%}
1010
}
1111

12+
1213
#include "../include/functions/copy.h"
1314
#include "../include/macros.h"
1415
#include "../include/{{ filename }}.h"
@@ -17,6 +18,9 @@ extern "C" {
1718
#include "{{ dependency }}"
1819
{%endeach%}
1920

21+
#include <iostream>
22+
23+
using namespace std;
2024
using namespace v8;
2125
using namespace node;
2226

generate/templates/struct_content.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern "C" {
1717
{%each dependencies as dependency%}
1818
#include "{{ dependency }}"
1919
{%endeach%}
20+
#include <iostream>
2021

2122
using namespace v8;
2223
using namespace node;
@@ -40,7 +41,7 @@ using namespace std;
4041
{{ cppClassName }}::~{{ cppClassName }}() {
4142
// This is going to cause memory leaks. We'll have to solve that later
4243
// TODO: Clean up memory better
43-
if (!this->selfFreeing) {
44+
if (this->selfFreeing) {
4445
free(this->raw);
4546
}
4647
}

generate/utils.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,6 @@ var Utils = {
270270
arg.isSelf = Utils.isPointer(arg.type) && normalizedType == classDef.cType;
271271

272272
if (arg.isReturn && fnDef.return && fnDef.return.type === "int") {
273-
debugger;
274273
fnDef.return.isErrorCode = true;
275274
fnDef.isAsync = true;
276275
}

lib/clone.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ Clone.clone = function(url, local_path, options) {
2222
options = normalizeOptions(options, NodeGit.CloneOptions);
2323

2424
if (remoteCallbacks) {
25-
options.remoteCallbacks = normalizeOptions(remoteCallbacks,
26-
NodeGit.RemoteCallbacks);
25+
options.remoteCallbacks =
26+
normalizeOptions(remoteCallbacks, NodeGit.RemoteCallbacks);
2727
}
2828

2929
return clone.call(this, url, local_path, options);

lib/tree_entry.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var path = require("path");
22
var NodeGit = require("../");
33

4+
var Tree = NodeGit.Tree;
45
var TreeEntry = NodeGit.TreeEntry;
56

67
/**
@@ -96,4 +97,8 @@ TreeEntry.prototype.toString = function() {
9697
return this.path();
9798
};
9899

100+
TreeEntry.prototype.oid = function() {
101+
return Tree.entryId(this).toString();
102+
};
103+
99104
module.exports = TreeEntry;

lib/util/normalize_oid.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function normalizeOid(oid) {
1111
return typeof oid === "string" ? NodeGit.Oid.fromString(oid) : oid;
1212
}
1313
catch (ex) {
14-
console.log(ex);
1514
return null;
1615
}
1716
}

test/tests/tree_entry.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,3 @@ describe("TreeEntry", function() {
7676
});
7777
});
7878
});
79-

0 commit comments

Comments
 (0)