From 030f1182bb36681381749f6cbee7817bce18798f Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sun, 17 Feb 2019 06:12:56 +0000 Subject: [PATCH] Cleanly shut down the git library upon process exit This change allows the libgit2 library to clean up after itself. This helps detect leaks. --- cmd/omegaup-gitserver/main.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cmd/omegaup-gitserver/main.go b/cmd/omegaup-gitserver/main.go index 07c6690..3e8f2c0 100644 --- a/cmd/omegaup-gitserver/main.go +++ b/cmd/omegaup-gitserver/main.go @@ -199,6 +199,8 @@ func (h *muxGitHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { } func main() { + defer git.Shutdown() + flag.Parse() if *version {