Shutdown frees all the resources acquired by libgit2. Make sure no references to any git2go objects are live before calling this. After this is called, invoking any function from this library will result in undefined behavior, so make sure this is called carefully.
()
| 175 | // After this is called, invoking any function from this library will result in |
| 176 | // undefined behavior, so make sure this is called carefully. |
| 177 | func Shutdown() { |
| 178 | if err := unregisterManagedTransports(); err != nil { |
| 179 | panic(err) |
| 180 | } |
| 181 | pointerHandles.Clear() |
| 182 | remotePointers.clear() |
| 183 | |
| 184 | C.git_libgit2_shutdown() |
| 185 | } |
| 186 | |
| 187 | // ReInit reinitializes the global state, this is useful if the effective user |
| 188 | // id has changed and you want to update the stored search paths for gitconfig |