Commit 5261658
fix: prevent crash from RequestConfigFinished signal connection
Changed the signal connection from lambda in Component.onCompleted
to proper Connections component. The previous approach using a lambda
directly connected to the signal could cause crashes when the component
was destroyed, as the lambda might outlive the QML context or create
dangling references. Using the Connections component ensures proper
lifecycle management and automatic disconnection when the component
is destroyed.
Influence:
1. Test opening and closing detail configuration pages multiple times
2. Verify no crash occurs when rapidly switching between different
configuration items
3. Test memory stability during extended usage of the configuration tool
4. Verify signal disconnection works correctly when components are
destroyed
5. Test that globalConfigOptions are properly refreshed when
RequestConfigFinished is emitted
fix: 修复 RequestConfigFinished 信号导致崩溃的问题
将信号连接方式从 Component.onCompleted 中的 lambda 改为使用 Connections
组件。之前直接在信号上连接 lambda 的方式可能在组件销毁时导致崩溃,因为
lambda 可能超出 QML 上下文的生命周期或产生悬空引用。使用 Connections 组
件可以确保正确的生命周期管理,并在组件销毁时自动断开连接。
Influence:
1. 测试多次打开和关闭详细配置页面
2. 验证在不同配置项之间快速切换时不会发生崩溃
3. 测试配置工具长时间使用时的内存稳定性
4. 验证组件销毁时信号断开连接是否正常工作
5. 测试 RequestConfigFinished 发出时 globalConfigOptions 是否正确刷新1 parent 4f54c90 commit 5261658
1 file changed
Lines changed: 8 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
193 | 201 | | |
194 | 202 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | 203 | | |
202 | 204 | | |
203 | 205 | | |
| |||
0 commit comments