[CDRIVER-1980] Incorrect lifecycle documentation needs review Created: 05/Jan/17  Updated: 05/May/17  Resolved: 05/May/17

Status: Closed
Project: C Driver
Component/s: docs, libmongoc
Affects Version/s: None
Fix Version/s: 1.7.0

Type: Task Priority: Minor - P4
Reporter: David Golden Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by CXX-1184 Prevent misuse of client temporaries Closed
Duplicate
is duplicated by CDRIVER-963 Document object-destruction order Closed

 Description   

From http://mongoc.org/libmongoc/current/mongoc_collection_t.html:

It is an error to call mongoc_collection_destroy() on a collection that has operations pending. It is required that you release mongoc_cursor_t structures before calling mongoc_collection_destroy().

From http://mongoc.org/libmongoc/current/mongoc_database_t.html

It is an error to call mongoc_database_destroy() on a database that has operations pending. It is required that you release mongoc_cursor_t structures before calling mongoc_database_destroy.

From http://mongoc.org/libmongoc/current/mongoc_client_t.html:

It is an error to call mongoc_client_destroy on a client that has operations pending. It is required that you release mongoc_collection_t and mongoc_database_t structures before calling mongoc_client_destroy.

Per discussion on Slack, mongoc_cursor_t only cares about mongoc_client_t. Is that true for other types as well? Please audit lifecycle constraint documentation and update as needed.



 Comments   
Comment by Githook User [ 05/May/17 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-1980 document main objects' lifecycles
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/f699143ed114637f8df9014b3cebc02fd7916cc4

Generated at Wed Feb 07 21:13:47 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.