summaryrefslogtreecommitdiff
path: root/commit.go
diff options
context:
space:
mode:
authorVicent Martí <[email protected]>2013-03-05 16:59:40 -0800
committerVicent Martí <[email protected]>2013-03-05 16:59:40 -0800
commit9b6d570748ae51bf38e3192f9a5de45bc68b23c6 (patch)
treed4494ed38a76fa9c69f4fc00513340ff0096f980 /commit.go
parent2885e3fe0cc403514d0ade13bae5f430b2e9252e (diff)
parentd43561fbf711896f5ce33f409c6000946416a82b (diff)
Merge pull request #3 from carlosmn/finalizers
Free Git objects via finalizers or manually
Diffstat (limited to 'commit.go')
-rw-r--r--commit.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/commit.go b/commit.go
index 855ed87..779ebd7 100644
--- a/commit.go
+++ b/commit.go
@@ -9,6 +9,7 @@ extern int _go_git_treewalk(git_tree *tree, git_treewalk_mode mode, void *ptr);
import "C"
import (
+ "runtime"
"time"
)
@@ -32,6 +33,8 @@ func (c *Commit) Tree() (*Tree, error) {
if err < 0 {
return nil, LastError()
}
+
+ runtime.SetFinalizer(tree, (*Tree).Free)
return tree, nil
}