Memory cleanup
There are some memory leaks and cleanup problems in styling engine. These should be addressed.
Blueprint information
- Status:
- Complete
- Approver:
- Zoltan Balogh
- Priority:
- Undefined
- Drafter:
- Zsombor Egri
- Direction:
- Needs approval
- Assignee:
- Zsombor Egri
- Definition:
- New
- Series goal:
- Accepted for raring
- Implementation:
- Implemented
- Milestone target:
- ubuntu-13.04-month-6
- Started by
- Zsombor Egri
- Completed by
- Zsombor Egri
Whiteboard
=== modified file 'modules/
--- modules/
+++ modules/
@@ -172,6 +172,10 @@
// remove name from the theming engine
if (!styleData.
+
+ delete componentContext;
+ //delete style; // FIXME: crashes the shell after unlock
+ delete delegate;
}
bool ItemStyleAttach
=== modified file 'modules/
--- modules/
+++ modules/
@@ -203,6 +203,8 @@
StyleTreeNode:
{
+ delete style;
+ delete delegate;
clear();
}
@@ -238,6 +240,8 @@
// had not yet have a style set
if (children.
+ delete node->style;
+ delete node->delegate;
} else {
Note: despite of setting parent for style and delegate objects, those are not deleted when the styled item (attachee) is destroyed. Therefore explicit deletion of those must be done.
Work Items
Work items:
Delete style and delegate objects explicitly in ItemStyleAttached destruction: DONE
Leak - context object used for style and delegate creation is not deleted: DONE
Safety deletion of style and delegate QQmlComponent objects when StyleCache tree is built: DONE
Dependency tree
* Blueprints in grey have been implemented.