From 7d29d6864474525c9853d86996d769a5459dc15d Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sat, 8 Jul 2017 11:38:19 +0200 Subject: Second round of keep-alives --- graph.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'graph.go') diff --git a/graph.go b/graph.go index e5d7732..688818c 100644 --- a/graph.go +++ b/graph.go @@ -13,6 +13,9 @@ func (repo *Repository) DescendantOf(commit, ancestor *Oid) (bool, error) { defer runtime.UnlockOSThread() ret := C.git_graph_descendant_of(repo.ptr, commit.toC(), ancestor.toC()) + runtime.KeepAlive(repo) + runtime.KeepAlive(commit) + runtime.KeepAlive(ancestor) if ret < 0 { return false, MakeGitError(ret) } @@ -28,6 +31,9 @@ func (repo *Repository) AheadBehind(local, upstream *Oid) (ahead, behind int, er var behindT C.size_t ret := C.git_graph_ahead_behind(&aheadT, &behindT, repo.ptr, local.toC(), upstream.toC()) + runtime.KeepAlive(repo) + runtime.KeepAlive(local) + runtime.KeepAlive(upstream) if ret < 0 { return 0, 0, MakeGitError(ret) } -- cgit v1.2.3