From 22425043bcaa66666b785b26189712d289f2abd1 Mon Sep 17 00:00:00 2001 From: lhchavez Date: Sun, 17 Feb 2019 06:21:23 +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-grader/main.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cmd/omegaup-grader/main.go b/cmd/omegaup-grader/main.go index 052be9b..b3d1eb7 100644 --- a/cmd/omegaup-grader/main.go +++ b/cmd/omegaup-grader/main.go @@ -11,6 +11,7 @@ import ( "flag" "fmt" _ "github.com/go-sql-driver/mysql" + git "github.com/lhchavez/git2go" _ "github.com/mattn/go-sqlite3" "github.com/omegaup/quark/common" "github.com/omegaup/quark/grader" @@ -170,6 +171,8 @@ func queEventsProcessor(events <-chan *grader.QueueEvent) { } func main() { + defer git.Shutdown() + flag.Parse() if *version {