Merged
Conversation
Changed m_config from std::unique_ptr to raw pointer to avoid crash in TreelandUserConfig destructor Removed reset() calls and replaced with direct assignment Updated config() method to return raw pointer instead of using get() This is a temporary workaround to prevent crashes caused by TreelandUserConfig destructor issues The change introduces memory leaks but will be reverted once the destructor is fixed properly Influence: 1. Test application startup and shutdown to ensure no crashes occur 2. Verify TreelandUserConfig functionality still works correctly 3. Monitor memory usage for potential leaks during extended use 4. Test user switching functionality to ensure config updates work properly chore: 临时禁用 TreelandUserConfig 智能指针 将 m_config 从 std::unique_ptr 改为原始指针以避免 TreelandUserConfig 析 构函数崩溃 移除 reset() 调用并改为直接赋值 更新 config() 方法返回原始指针而非使用 get() 这是临时解决方案,用于防止 TreelandUserConfig 析构函数问题导致的崩溃 此更改会引入内存泄漏,但将在析构函数修复后撤销
Log: new tag
|
TAG Bot TAG: 0.8.0 |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideRefactors Helper::m_config from a std::unique_ptr-managed TreelandUserConfig to a raw pointer, updating its initialization and usage in the constructor, init() lambda, and accessor method to match the new ownership model. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- Switching
m_configfromstd::unique_ptrto a raw pointer removes clear ownership semantics and will leak the previously allocated config inupdateCurrentUser; either keepstd::unique_ptror add explicit deletion logic (e.g., RAII or a smart pointer) when reassigning. - If
m_configis now a raw pointer, ensureHelper's destructor (or an appropriate cleanup path) explicitly destroys it to avoid leaking the initialTreelandUserConfig::createByNameinstance created in the constructor.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Switching `m_config` from `std::unique_ptr` to a raw pointer removes clear ownership semantics and will leak the previously allocated config in `updateCurrentUser`; either keep `std::unique_ptr` or add explicit deletion logic (e.g., RAII or a smart pointer) when reassigning.
- If `m_config` is now a raw pointer, ensure `Helper`'s destructor (or an appropriate cleanup path) explicitly destroys it to avoid leaking the initial `TreelandUserConfig::createByName` instance created in the constructor.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
zccrs
approved these changes
Jan 4, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee, zccrs The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This was referenced Jan 4, 2026
Draft
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.
Summary by Sourcery
Adjust Helper configuration member ownership and access patterns.
Bug Fixes:
Enhancements: