summaryrefslogtreecommitdiff
path: root/stash.go
diff options
context:
space:
mode:
authorCarlos Martín Nieto <[email protected]>2017-07-08 16:51:22 +0200
committerGitHub <[email protected]>2017-07-08 16:51:22 +0200
commit08db2e2c167404c5ed9be0fc1c995e41bad479bb (patch)
tree4a9c1357f3682d4134318e73ef85aa172cbfbd48 /stash.go
parent29c0b730076fe402c22ea3e3a11a7ed541663637 (diff)
parent55a1096141519a1f380d0702671cfe9bf90ec435 (diff)
Merge pull request #393 from libgit2/cmn/keepalive-all-the-things
KeepAlive all the things
Diffstat (limited to 'stash.go')
-rw-r--r--stash.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/stash.go b/stash.go
index 809732e..8743da8 100644
--- a/stash.go
+++ b/stash.go
@@ -63,7 +63,7 @@ func (c *StashCollection) Save(
ret := C.git_stash_save(
oid.toC(), c.repo.ptr,
stasherC, messageC, C.uint32_t(flags))
-
+ runtime.KeepAlive(c)
if ret < 0 {
return nil, MakeGitError(ret)
}
@@ -228,6 +228,7 @@ func (c *StashCollection) Apply(index int, opts StashApplyOptions) error {
defer runtime.UnlockOSThread()
ret := C.git_stash_apply(c.repo.ptr, C.size_t(index), optsC)
+ runtime.KeepAlive(c)
if ret == C.GIT_EUSER {
return progressData.Error
}
@@ -282,6 +283,7 @@ func (c *StashCollection) Foreach(callback StashCallback) error {
defer runtime.UnlockOSThread()
ret := C._go_git_stash_foreach(c.repo.ptr, handle)
+ runtime.KeepAlive(c)
if ret == C.GIT_EUSER {
return data.Error
}
@@ -303,6 +305,7 @@ func (c *StashCollection) Drop(index int) error {
defer runtime.UnlockOSThread()
ret := C.git_stash_drop(c.repo.ptr, C.size_t(index))
+ runtime.KeepAlive(c)
if ret < 0 {
return MakeGitError(ret)
}
@@ -328,6 +331,7 @@ func (c *StashCollection) Pop(index int, opts StashApplyOptions) error {
defer runtime.UnlockOSThread()
ret := C.git_stash_pop(c.repo.ptr, C.size_t(index), optsC)
+ runtime.KeepAlive(c)
if ret == C.GIT_EUSER {
return progressData.Error
}