summaryrefslogtreecommitdiff
path: root/remote.go
diff options
context:
space:
mode:
authorlhchavez <[email protected]>2020-12-10 05:35:40 -0800
committerGitHub <[email protected]>2020-12-10 05:35:40 -0800
commite28cce87c7551bffa1f4602ff492348f9a8cba60 (patch)
tree17cda66f878bd6285f24d0867c444e9ca2e191e6 /remote.go
parentabf02bc7d79dfb7b0bbcd404ebecb202cff2a18e (diff)
Ensure that no pointer handles leak during the test (#712)
This change makes sure that pointer handles are correctly cleaned up during tests.
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/remote.go b/remote.go
index 795f9af..b1c8532 100644
--- a/remote.go
+++ b/remote.go
@@ -435,10 +435,12 @@ func RemoteIsValidName(name string) bool {
return C.git_remote_is_valid_name(cname) == 1
}
+// Free releases the resources of the Remote.
func (r *Remote) Free() {
runtime.SetFinalizer(r, nil)
C.git_remote_free(r.ptr)
r.ptr = nil
+ r.repo = nil
}
type RemoteCollection struct {