From 55a1096141519a1f380d0702671cfe9bf90ec435 Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Sat, 8 Jul 2017 16:07:51 +0200 Subject: Third round of keep-alive aditions --- stash.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'stash.go') 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 } -- cgit v1.2.3