File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,28 @@ layout: toc
6
6
7
7
<h2 id =" best_practices " >Best Practices</h2 >
8
8
9
+ <h3 id =" best_practices_init " >Initialize the library</h3 >
10
+
11
+ The library needs to keep some global state and initialize its
12
+ dependencies. You must therefore initialize the library before working
13
+ with it
14
+
15
+ ``` C
16
+ git_libgit2_init ();
17
+ ```
18
+
19
+ Usually you don't need to call the shutdown function as the operating
20
+ system will take care of reclaiming resources, but if your application
21
+ uses libgit2 in some areas which are not usually active, you can use
22
+
23
+ ``` C
24
+ git_libgit2_shutdown ();
25
+ ```
26
+
27
+ to ask the library to clean up the global state. The cleanup will be
28
+ performed once there have been the same number of calls to
29
+ ` git_libgit2_shutdown() ` as there were for ` git_libgit2_init() ` .
30
+
9
31
<h3 id =" best_practices_errors " >Errors</h3 >
10
32
11
33
Return codes from public APIs indicate general failure category.
You can’t perform that action at this time.
0 commit comments