File: mg_exit_library.md

package info (click to toggle)
civetweb 1.16%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 4,576 kB
  • sloc: ansic: 32,463; cpp: 1,374; sh: 480; javascript: 204; makefile: 119; php: 11; perl: 6; python: 3
file content (30 lines) | stat: -rw-r--r-- 1,100 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Civetweb API Reference

### `mg_exit_library( );`

### Parameters

none

### Return Value

| Type | Description |
| :--- | :--- |
|`unsigned`| **0** is returned or error |

### Description

The function `mg_exit_library()` should be called from an application program, when the library should be unloaded.
It can be called multiple times (`mg_init_library` and `mg_exit_library` are reference counting).
However, the caller must make sure it is not called in parallel (it is not guaranteed to be thread safe).

Only use `mg_exit_library( );` when you used [`mg_init_library( feature );`](api/mg_init_library.md) before.

The library init and exit functions are new in version 1.9 (as dummy implementation) and effective only from version 1.10.
For compatibility reasons, other functions (such as [`mg_start();`](mg_start.md)) will initialize the required features as well,
but they will no longer do a de-initialization, leaving a memory leak when the library is unloaded.

### See Also

* [`mg_init_library( feature );`](mg_init_library.md)
* [`mg_check_feature( feature );`](mg_check_feature.md)