Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-1909

Improve mongoc_init and mongoc_cleanup docs

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.6.0
    • Affects Version/s: 1.3.3
    • Component/s: docs, libmongoc
    • Labels:
      None

      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

            Assignee:
            jesse@mongodb.com A. Jesse Jiryu Davis
            Reporter:
            andre.maute andre maute
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: