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
001befcd
Commit
001befcd
authored
May 06, 2014
by
Anurag Gupta
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the issues in git__on_shutdown
parent
d2c16e9a
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
src/global.c
+6
-4
src/sysdir.c
+2
-0
No files found.
src/global.c
View file @
001befcd
...
@@ -23,7 +23,7 @@ static git_atomic git__n_inits;
...
@@ -23,7 +23,7 @@ static git_atomic git__n_inits;
void
git__on_shutdown
(
git_global_shutdown_fn
callback
)
void
git__on_shutdown
(
git_global_shutdown_fn
callback
)
{
{
int
count
=
git_atomic_inc
(
&
git__n_shutdown_callbacks
);
int
count
=
git_atomic_inc
(
&
git__n_shutdown_callbacks
);
assert
(
count
<=
MAX_SHUTDOWN_CB
);
assert
(
count
<=
MAX_SHUTDOWN_CB
&&
count
>
0
);
git__shutdown_callbacks
[
count
-
1
]
=
callback
;
git__shutdown_callbacks
[
count
-
1
]
=
callback
;
}
}
...
@@ -31,10 +31,12 @@ static void git__shutdown(void)
...
@@ -31,10 +31,12 @@ static void git__shutdown(void)
{
{
int
pos
;
int
pos
;
while
((
pos
=
git_atomic_dec
(
&
git__n_shutdown_callbacks
))
>=
0
)
{
for
(
pos
=
git_atomic_get
(
&
git__n_shutdown_callbacks
);
pos
>
0
;
pos
=
git_atomic_dec
(
&
git__n_shutdown_callbacks
))
if
(
git__shutdown_callbacks
[
pos
])
if
(
git__shutdown_callbacks
[
pos
-
1
])
{
git__shutdown_callbacks
[
pos
]();
git__shutdown_callbacks
[
pos
-
1
]();
git__shutdown_callbacks
[
pos
-
1
]
=
NULL
;
}
}
}
}
/**
/**
...
...
src/sysdir.c
View file @
001befcd
...
@@ -90,6 +90,8 @@ void git_sysdir_global_shutdown(void)
...
@@ -90,6 +90,8 @@ void git_sysdir_global_shutdown(void)
int
i
;
int
i
;
for
(
i
=
0
;
i
<
GIT_SYSDIR__MAX
;
++
i
)
for
(
i
=
0
;
i
<
GIT_SYSDIR__MAX
;
++
i
)
git_buf_free
(
&
git_sysdir__dirs
[
i
]);
git_buf_free
(
&
git_sysdir__dirs
[
i
]);
git_sysdir__dirs_shutdown_set
=
0
;
}
}
static
int
git_sysdir_check_selector
(
git_sysdir_t
which
)
static
int
git_sysdir_check_selector
(
git_sysdir_t
which
)
...
...
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