set ptr to nil after free

This commit is contained in:
Jesse Ezell 2014-03-20 23:19:22 -07:00
parent d78036fe24
commit aea899e877
2 changed files with 2 additions and 0 deletions

View File

@ -147,6 +147,7 @@ func (diff *Diff) Free() error {
}
runtime.SetFinalizer(diff, nil)
C.git_diff_free(diff.ptr)
diff.ptr = nil
return nil
}

View File

@ -31,6 +31,7 @@ func (patch *Patch) Free() error {
}
runtime.SetFinalizer(patch, nil)
C.git_patch_free(patch.ptr)
patch.ptr = nil
return nil
}