Update: to close this ticket, ensure that it's documented that mongoc_cleanup should be called once, and no other C Driver functions, not even mongoc_init, can be called after. Also, add links between mongoc_init, mongoc_cleanup, and the index page. Right now mongoc_cleanup is isolated.
After a long debugging tour I learned
that calling mongoc_init() and mongoc_cleanup() multiple times is bad practice
which might result in segmentation faults.
I suggest hereby adding
assert(once==MONGOC_ONCE_INIT)
to the implemetnations of these two functions,
for indicating that there might be a problem.
Regards
Andre