[CDRIVER-3362] Clarify lifetime of mongoc_client_session_get_opts return value Created: 05/Sep/19  Updated: 28/Oct/23  Resolved: 10/Sep/21

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

Type: Improvement Priority: Minor - P4
Reporter: Jeremy Mikola Assignee: Ezra Chung
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

Documentation formongoc_client_session_get_opts should clarify that the returned pointer is only valid for the lifetime of the client session. Additionally, we can advise users about mongoc_session_opts_clone() and mongoc_session_opts_destroy() if they would like a permanent copy not bound to the lifetime of the session object.

I know this is done in a few places for other get methods in libmongoc, but I'm not sure if this instance was intentional or simply an oversight.



 Comments   
Comment by Githook User [ 10/Sep/21 ]

Author:

{'name': 'Ezra Chung', 'email': '88335979+eramongodb@users.noreply.github.com', 'username': 'eramongodb'}

Message: CDRIVER-3362 update documentation for non-owning return values (#864)
Branch: master
https://github.com/mongodb/mongo-c-driver/commit/30e136893f5fc3a9a1c2a23fe86e8274ab6960e0

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