-
Notifications
You must be signed in to change notification settings - Fork 34
Tag 0.8.0 #676
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tag 0.8.0 #676
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
|
[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 |
Summary by Sourcery
Adjust Helper configuration member ownership and access patterns.
Bug Fixes:
Enhancements: