Commit eed3350
committed
fix: fix repeater child object crash without parent
Add memory management feature flag DCC_MEMORY_MANAGEME to control object
ownership and deletion behavior. Implement DccQuickRepeater to ensure
child items have proper parent relationships. Fix potential crashes
when repeater child objects lack parent objects by setting ownership and
parent relationships correctly.
Changes include:
1. Add DCC_MEMORY_MANAGEME compile flag to control memory management
features
2. Create DccQuickRepeater class that automatically sets parent for
child items
3. Replace standard Repeater with DccQuickRepeater in QML files
4. Improve object ownership management in DccObject child handling
5. Add conditional memory cleanup in DccManager with safety checks
Log: Fixed crash issue when repeater child objects have no parent
objects
Influence:
1. Test repeater functionality in various modules (accounts, datetime,
display, etc.)
2. Verify no crashes when dynamically adding/removing repeater items
3. Check memory usage and cleanup during application exit
4. Test object parent relationships in QML components
5. Verify timezone dialog and other repeater-based components work
correctly
fix: 修复Repeater子对象无父对象导致的崩溃问题
添加内存管理功能标志DCC_MEMORY_MANAGEME来控制对象所有权和删除行为。实现
DccQuickRepeater确保子项具有正确的父子关系。通过正确设置所有权和父子关系
修复当Repeater子对象缺少父对象时可能发生的崩溃问题。
变更包括:
1. 添加DCC_MEMORY_MANAGEME编译标志控制内存管理功能
2. 创建DccQuickRepeater类自动为子项设置父对象
3. 在QML文件中将标准Repeater替换为DccQuickRepeater
4. 改进DccObject子项处理中的对象所有权管理
5. 在DccManager中添加带安全检查的条件内存清理
Log: 修复Repeater子对象无父对象导致的崩溃问题
Influence:
1. 测试各模块中的Repeater功能(账户、时间日期、显示等)
2. 验证动态添加/删除Repeater项时不会崩溃
3. 检查应用程序退出时的内存使用和清理情况
4. 测试QML组件中的对象父子关系
5. 验证时区对话框和其他基于Repeater的组件正常工作
PMS: BUG-3070371 parent 3363f9e commit eed3350
File tree
19 files changed
+77
-10
lines changed- include
- src
- dde-control-center
- frame
- plugin
- src
- plugin-accounts/qml
- plugin-datetime/qml
- plugin-display/qml
- plugin-personalization/qml
- plugin-power/qml
19 files changed
+77
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
101 | 102 | | |
102 | 103 | | |
103 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
104 | 108 | | |
105 | 109 | | |
106 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
558 | 558 | | |
559 | 559 | | |
560 | 560 | | |
561 | | - | |
| 561 | + | |
562 | 562 | | |
563 | 563 | | |
564 | 564 | | |
| |||
933 | 933 | | |
934 | 934 | | |
935 | 935 | | |
936 | | - | |
| 936 | + | |
937 | 937 | | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
938 | 941 | | |
939 | 942 | | |
940 | 943 | | |
| |||
961 | 964 | | |
962 | 965 | | |
963 | 966 | | |
964 | | - | |
| 967 | + | |
965 | 968 | | |
966 | 969 | | |
967 | 970 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | | - | |
| 123 | + | |
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
195 | 195 | | |
196 | 196 | | |
197 | 197 | | |
| 198 | + | |
198 | 199 | | |
199 | | - | |
200 | | - | |
201 | 200 | | |
202 | 201 | | |
203 | 202 | | |
| |||
206 | 205 | | |
207 | 206 | | |
208 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
493 | 495 | | |
494 | 496 | | |
495 | 497 | | |
| 498 | + | |
496 | 499 | | |
497 | 500 | | |
498 | 501 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
0 commit comments