From 58334cf60441bd713b8fd990e30e0580b97bf3ae Mon Sep 17 00:00:00 2001 From: Carlos Martín Nieto Date: Fri, 7 Jul 2017 23:45:09 +0200 Subject: First round of mass keep-alive additions --- describe.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'describe.go') diff --git a/describe.go b/describe.go index d75dbcb..0b75076 100644 --- a/describe.go +++ b/describe.go @@ -128,6 +128,7 @@ func (c *Commit) Describe(opts *DescribeOptions) (*DescribeResult, error) { defer runtime.UnlockOSThread() ecode := C.git_describe_commit(&resultPtr, c.ptr, cDescribeOpts) + runtime.KeepAlive(c) if ecode < 0 { return nil, MakeGitError(ecode) } @@ -162,6 +163,7 @@ func (repo *Repository) DescribeWorkdir(opts *DescribeOptions) (*DescribeResult, defer runtime.UnlockOSThread() ecode := C.git_describe_workdir(&resultPtr, repo.ptr, cDescribeOpts) + runtime.KeepAlive(repo) if ecode < 0 { return nil, MakeGitError(ecode) } @@ -206,6 +208,7 @@ func (result *DescribeResult) Format(opts *DescribeFormatOptions) (string, error defer runtime.UnlockOSThread() ecode := C.git_describe_format(&resultBuf, result.ptr, cFormatOpts) + runtime.KeepAlive(result) if ecode < 0 { return "", MakeGitError(ecode) } -- cgit v1.2.3