summaryrefslogtreecommitdiff
path: root/config.go
diff options
context:
space:
mode:
authorArtiom Di <[email protected]>2013-11-14 15:24:43 +0200
committerArtiom Di <[email protected]>2013-11-14 15:24:43 +0200
commit5e30c192e9f7219322887da7252c344d5be1ec05 (patch)
treed82a9bc90cb9198ff2f9d1cb893eb530387fcde9 /config.go
parent295ec8894c0e96330a106d4854bea5c1e9d37f20 (diff)
Fix memleak for Config and parent commit objects
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)
+}