Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-11 23:45:20 +0400
committerRussell Belfer <rb@github.com>2013-09-17 20:31:45 +0400
commita3aa5f4d5dcbe038f1d1c5ff40eed29d27953fbe (patch)
tree6ef7a6b5bdfc26e10279c2629f58036f4025f199 /src/global.h
parente7d0ced2192c5efeea6d9f5667d366891010b86a (diff)
Add simple global shutdown hooks
Increasingly there are a number of components that want to do some cleanup at global shutdown time (at least if there are not going to be memory leaks). This creates a very simple system of shutdown hooks that will be invoked by git_threads_shutdown. Right now, the maximum number of hooks is hardcoded, but since adding a hook is not a public API, it should be fine and I thought it was better to start off with really simple code.
Diffstat (limited to 'src/global.h')
-rw-r--r--src/global.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/global.h b/src/global.h
index badbc0883..778250376 100644
--- a/src/global.h
+++ b/src/global.h
@@ -21,4 +21,8 @@ extern git_mutex git__mwindow_mutex;
#define GIT_GLOBAL (git__global_state())
+typedef void (*git_global_shutdown_fn)(void);
+
+extern void git__on_shutdown(git_global_shutdown_fn callback);
+
#endif