[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: |
| 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. |