diff options
| author | Carlos Martín Nieto <[email protected]> | 2017-07-07 23:45:09 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <[email protected]> | 2017-07-08 09:11:38 +0200 |
| commit | 58334cf60441bd713b8fd990e30e0580b97bf3ae (patch) | |
| tree | f9338ec81be5dda689a0f64744033cbc01bb3179 /checkout.go | |
| parent | 0e9336be3f590b900a28a48b265dd2eab7836e03 (diff) | |
First round of mass keep-alive additions
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) } |
