summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorVicent Martí <[email protected]>2013-11-18 07:24:37 -0800
committerVicent Martí <[email protected]>2013-11-18 07:24:37 -0800
commit625ffd022e2c39f3820543cc1239deeb21837266 (patch)
treed82a9bc90cb9198ff2f9d1cb893eb530387fcde9 /config.go
parentd8c3772e350f387bb55b74dc1d654d69bd66b69a (diff)
parent5e30c192e9f7219322887da7252c344d5be1ec05 (diff)
Merge pull request #47 from kron4eg/tree_builder_mem_leak
Fix memleak, TreeBuilder, Config and Parent commit
Diffstat (limited to 'config.go')
-rw-r--r--config.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/config.go b/config.go
index dcad2a7..7235716 100644
--- a/config.go
+++ b/config.go
@@ -6,6 +6,7 @@ package git
*/
import "C"
import (
+ "runtime"
"unsafe"
)
@@ -66,3 +67,8 @@ func (c *Config) Set(name, value string) (err error) {
return nil
}
+
+func (c *Config) Free() {
+ runtime.SetFinalizer(c, nil)
+ C.git_config_free(c.ptr)
+}