diff options
| author | Carlos MartÃn Nieto <[email protected]> | 2017-07-08 16:51:22 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2017-07-08 16:51:22 +0200 |
| commit | 08db2e2c167404c5ed9be0fc1c995e41bad479bb (patch) | |
| tree | 4a9c1357f3682d4134318e73ef85aa172cbfbd48 /graph.go | |
| parent | 29c0b730076fe402c22ea3e3a11a7ed541663637 (diff) | |
| parent | 55a1096141519a1f380d0702671cfe9bf90ec435 (diff) | |
Merge pull request #393 from libgit2/cmn/keepalive-all-the-things
KeepAlive all the things
Diffstat (limited to 'graph.go')
| -rw-r--r-- | graph.go | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -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) } |
