Skip to content

Commit

Permalink
Cleanly shut down the git library upon process exit
Browse files Browse the repository at this point in the history
This change allows the libgit2 library to clean up after itself. This
helps detect leaks.
  • Loading branch information
lhchavez committed Feb 17, 2019
1 parent a1f6822 commit 2242504
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cmd/omegaup-grader/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -170,6 +171,8 @@ func queEventsProcessor(events <-chan *grader.QueueEvent) {
}

func main() {
defer git.Shutdown()

flag.Parse()

if *version {
Expand Down

0 comments on commit 2242504

Please sign in to comment.