1MONGOC_INIT_CLEANUP(3)             libmongoc            MONGOC_INIT_CLEANUP(3)
2
3
4

NAME

6       mongoc_init_cleanup - Initialization and cleanup
7

SYNOPSIS

9       Initialize  the MongoDB C Driver by calling mongoc_init exactly once at
10       the beginning of your  program.  It  is  responsible  for  initializing
11       global state such as process counters, SSL, and threading primitives.
12
13       Exception  to  this is mongoc_log_set_handler(), which should be called
14       before mongoc_init() or some log traces would not use your log handling
15       function. See Custom Log Handlers for a detailed example.
16
17       Call  mongoc_cleanup exactly once at the end of your program to release
18       all memory and other resources allocated by the driver.  You  must  not
19       call  any  other  MongoDB C Driver functions after mongoc_cleanup. Note
20       that mongoc_init does not reinitialize the driver after mongoc_cleanup.
21

DEPRECATED FEATURE: AUTOMATIC INITIALIZATION AND CLEANUP

23       On some platforms the driver can automatically call mongoc_init  before
24       main, and call mongoc_cleanup as the process exits. This is problematic
25       in situations where related libraries  also  execute  cleanup  code  on
26       shutdown, and it creates inconsistent rules across platforms. Therefore
27       the automatic initialization and cleanup  feature  is  deprecated,  and
28       will  be dropped in version 2.0. Meanwhile, for backward compatibility,
29       the feature is enabled by default on platforms where it is available.
30
31       For portable, future-proof  code,  always  call  mongoc_init  and  mon‐
32       goc_cleanup yourself, and configure the driver like:
33
34          cmake -DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF
35

AUTHOR

37       MongoDB, Inc
38
40       2017-present, MongoDB, Inc
41
42
43
44
451.20.0                           Nov 18, 2021           MONGOC_INIT_CLEANUP(3)
Impressum