Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
ced843f4
Commit
ced843f4
authored
Sep 29, 2014
by
Edward Thomson
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2559 from libgit2/cmn/free-tls-error
global: free the error message when exiting a thread
parents
cb4a956b
fdea219a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
0 deletions
+17
-0
src/global.c
+3
-0
tests/threads/basic.c
+14
-0
No files found.
src/global.c
View file @
ced843f4
...
...
@@ -223,6 +223,9 @@ int init_error = 0;
static
void
cb__free_status
(
void
*
st
)
{
git_global_st
*
state
=
(
git_global_st
*
)
st
;
git__free
(
state
->
error_t
.
message
);
git__free
(
st
);
}
...
...
tests/threads/basic.c
View file @
ced843f4
#include "clar_libgit2.h"
#include "thread_helpers.h"
#include "cache.h"
...
...
@@ -34,3 +35,16 @@ void test_threads_basic__multiple_init(void)
cl_git_pass
(
git_repository_open
(
&
nested_repo
,
cl_fixture
(
"testrepo.git"
)));
git_repository_free
(
nested_repo
);
}
static
void
*
set_error
(
void
*
dummy
)
{
giterr_set
(
GITERR_INVALID
,
"oh no, something happened!
\n
"
);
return
dummy
;
}
/* Set errors so we can check that we free it */
void
test_threads_basic__set_error
(
void
)
{
run_in_parallel
(
1
,
4
,
set_error
,
NULL
,
NULL
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment