Manage CCharEntity::PMeritPoints with unique_ptr#7679
Merged
zach2good merged 1 commit intoLandSandBoat:basefrom Jul 9, 2025
Merged
Manage CCharEntity::PMeritPoints with unique_ptr#7679zach2good merged 1 commit intoLandSandBoat:basefrom
zach2good merged 1 commit intoLandSandBoat:basefrom
Conversation
zach2good
reviewed
Jul 8, 2025
src/map/entities/charentity.cpp
Outdated
| destroy(UContainer); | ||
| destroy(CraftContainer); | ||
| destroy(PMeritPoints); | ||
| PMeritPoints.reset(); |
Contributor
There was a problem hiding this comment.
This isn't needed. The point of using unique_ptr is that it'll clear up the underlying object when it is destructed, which is in this scope.
Contributor
Author
There was a problem hiding this comment.
Updated. I also added a test plan to sanity check the change of member delete order.
Contributes to LandSandBoat#5171 by converting PMeritPoints raw pointer to unique_ptr.
d0492f4 to
8b0422d
Compare
Contributor
Author
|
Not sure about this CI signal. |
zach2good
approved these changes
Jul 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I affirm:
What does this pull request do?
Contributes to #5171 by converting PMeritPoints raw pointer to unique_ptr.
Steps to test these changes
Test1: Added merits to a test character and observed their effect being applied in stats menu.
Test2: Logged in and /shutdown to trigger CCharEntity::~CCharEntity() to observe change of destruction timing for PMeritPoints doesn't impact anything.