Skip to content

Conversation

@FrankYFTang
Copy link
Collaborator

@FrankYFTang FrankYFTang requested a review from grhoten July 15, 2025 02:45
auto tokenizer = new Tokenizer(TOKENIZER_CONSTRUCTORS[mid].construct(locale, systemConfig));
// Initialize the data loading and caches so that it doesn't possibly fail later.
delete npc(tokenizer)->createTokenChain(u"initialization");
::std::unique_ptr<TokenChain> unused(npc(tokenizer)->createTokenChain(u"initialization"));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The original was actually correct. There is no intermediate line between getting the object and deleting it. I recommend leaving this one alone.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I can take this out

@FrankYFTang
Copy link
Collaborator Author

PTAL

@FrankYFTang FrankYFTang requested a review from grhoten July 22, 2025 03:12
@grhoten
Copy link
Member

grhoten commented Jul 22, 2025

I think the only remaining change needed is the Inflector.hpp change to make the destructor public is needed.

@FrankYFTang
Copy link
Collaborator Author

Changed according to comments. PTAL

@FrankYFTang FrankYFTang merged commit b3178d3 into unicode-org:main Jul 22, 2025
6 checks passed
@FrankYFTang FrankYFTang deleted the uniptr1 branch July 22, 2025 23:29
deonajulary06 pushed a commit that referenced this pull request Aug 21, 2025
* Use std::unique_ptr to avoid delete

* Remove change to warm up code

* Make destructor public instead of adding friend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants