diff options
| author | Artiom Di <[email protected]> | 2013-11-14 15:24:43 +0200 |
|---|---|---|
| committer | Artiom Di <[email protected]> | 2013-11-14 15:24:43 +0200 |
| commit | 5e30c192e9f7219322887da7252c344d5be1ec05 (patch) | |
| tree | d82a9bc90cb9198ff2f9d1cb893eb530387fcde9 /config.go | |
| parent | 295ec8894c0e96330a106d4854bea5c1e9d37f20 (diff) | |
Fix memleak for Config and parent commit objects
Diffstat (limited to 'config.go')
| -rw-r--r-- | config.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) +} |
