Fix some missing keepalives

This commit is contained in:
Michael Boulton 2020-08-17 08:05:44 +01:00
parent ad65e109e4
commit 067989fe99
No known key found for this signature in database
GPG Key ID: 8A62CA0BE2E0197E
1 changed files with 4 additions and 1 deletions

View File

@ -957,8 +957,11 @@ func (v *Repository) ApplyDiff(diff *Diff, location GitApplyLocation, opts *Appl
runtime.LockOSThread() runtime.LockOSThread()
defer runtime.UnlockOSThread() defer runtime.UnlockOSThread()
ecode := C.git_apply(v.ptr, diff.ptr, C.git_apply_location_t(location), opts.toC()) cOpts := opts.toC()
ecode := C.git_apply(v.ptr, diff.ptr, C.git_apply_location_t(location), cOpts)
runtime.KeepAlive(v) runtime.KeepAlive(v)
runtime.KeepAlive(diff)
runtime.KeepAlive(cOpts)
if ecode < 0 { if ecode < 0 {
return MakeGitError(ecode) return MakeGitError(ecode)
} }