MCPcopy Create free account
hub / github.com/libgit2/git2go / Free

Method Free

transport.go:281–296  ·  view source on GitHub ↗

Free releases all resources used by the RegisteredSmartTransport and unregisters the custom transport definition referenced by it.

()

Source from the content-addressed store, hash-verified

279// Free releases all resources used by the RegisteredSmartTransport and
280// unregisters the custom transport definition referenced by it.
281func (t *RegisteredSmartTransport) Free() error {
282 runtime.LockOSThread()
283 defer runtime.UnlockOSThread()
284
285 cstr := C.CString(t.name)
286 defer C.free(unsafe.Pointer(cstr))
287
288 if ret := C.git_transport_unregister(cstr); ret < 0 {
289 return MakeGitError(ret)
290 }
291
292 pointerHandles.Untrack(t.handle)
293 runtime.SetFinalizer(t, nil)
294 t.handle = nil
295 return nil
296}
297
298//export smartTransportCallback
299func smartTransportCallback(

Callers 1

TestTransportFunction · 0.95

Calls 3

MakeGitErrorFunction · 0.85
freeMethod · 0.80
UntrackMethod · 0.80

Tested by 1

TestTransportFunction · 0.76