Fix memleak, TreeBuilder, Config and Parent commit #47

Merged
kron4eg merged 2 commits from tree_builder_mem_leak into master 2013-11-18 09:24:37 -06:00
1 changed files with 4 additions and 3 deletions
Showing only changes of commit 295ec8894c - Show all commits

View File

@ -6,8 +6,8 @@ package git
*/
import "C"
import (
"unsafe"
"runtime"
"unsafe"
)
// Repository
@ -226,7 +226,7 @@ func (repo *Repository) Path() string {
return C.GoString(C.git_repository_path(repo.ptr))
}
func (repo *Repository) IsBare() (bool) {
func (repo *Repository) IsBare() bool {
return C.git_repository_is_bare(repo.ptr) != 0
}
@ -249,6 +249,7 @@ func (v *Repository) TreeBuilder() (*TreeBuilder, error) {
if ret := C.git_treebuilder_create(&bld.ptr, nil); ret < 0 {
return nil, LastError()
}
runtime.SetFinalizer(bld, (*TreeBuilder).Free)
bld.repo = v
return bld, nil