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 /checkout.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 'checkout.go')
| -rw-r--r-- | checkout.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/checkout.go b/checkout.go index f5822c9..db3118f 100644 --- a/checkout.go +++ b/checkout.go @@ -188,6 +188,7 @@ func (v *Repository) CheckoutHead(opts *CheckoutOpts) error { defer freeCheckoutOpts(cOpts) ret := C.git_checkout_head(v.ptr, cOpts) + runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } @@ -211,6 +212,7 @@ func (v *Repository) CheckoutIndex(index *Index, opts *CheckoutOpts) error { defer freeCheckoutOpts(cOpts) ret := C.git_checkout_index(v.ptr, iptr, cOpts) + runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } @@ -226,6 +228,7 @@ func (v *Repository) CheckoutTree(tree *Tree, opts *CheckoutOpts) error { defer freeCheckoutOpts(cOpts) ret := C.git_checkout_tree(v.ptr, tree.ptr, cOpts) + runtime.KeepAlive(v) if ret < 0 { return MakeGitError(ret) } |
