[SERVER-54444] Add a virtual destructor to the Ident class to ensure defined smart pointer destructor calls Created: 10/Feb/21  Updated: 29/Oct/23  Resolved: 18/Feb/21

Status: Closed
Project: Core Server
Component/s: Storage
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Improvement Priority: Major - P3
Reporter: Dianna Hohensee (Inactive) Assignee: Dianna Hohensee (Inactive)
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2021-02-22
Participants:

 Comments   
Comment by Githook User [ 18/Feb/21 ]

Author:

{'name': 'Dianna Hohensee', 'email': 'dianna.hohensee@mongodb.com', 'username': 'DiannaHohensee'}

Message: SERVER-54444 Add a virtual destructor to the Ident base class to ensure defined destructor calls
Branch: master
https://github.com/mongodb/mongo/commit/0b643d8853147c4eb8a2dd3e1dd7fccb62d235f6

Comment by Billy Donahue [ 10/Feb/21 ]

I like protected nonvirtual destructor. Then if we don't need a polymorphic destructor (shared_ptr doesn't) we don't pay for one.

While you're in there, it's missing an include for string_data.h.

The ctor could take a std::string by value and move it into place instead of messing with StringData. It's simpler, and that way if the caller already has a std::string rvalue there's no copy. It just moves into place.

 

The 1-arg constructor needs to be explicit unless you mean strings to be implicitly converted to Ident. It looks unintentional.

Generated at Thu Feb 08 05:33:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.