Bug 453201

Summary: Kirigami.ApplicationItem causes heavy memory leaks when used in QQuickView
Product: [Frameworks and Libraries] frameworks-kirigami Reporter: Fushan Wen <qydwhotmail>
Component: generalAssignee: Marco Martin <notmart>
Status: RESOLVED FIXED    
Severity: major CC: nate
Priority: NOR    
Version: Master   
Target Milestone: Not decided   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In: 5.95
Attachments: ApplicationItemLeakTest.tar.gz

Description Fushan Wen 2022-04-29 16:44:28 UTC
Created attachment 148460 [details]
ApplicationItemLeakTest.tar.gz

SUMMARY
Kirigami.ApplicationItem doesn't free its memory after QQuickView is destroyed. For more information please see the example program in the attachment. The bug has caused severe memory leaks in Plasma config dialog, especially the wallpaper config dialog.

STEPS TO REPRODUCE
1. Run ApplicationItemLeakTest
2. Watch system monitor

OBSERVED RESULT
Memory grows very fast

EXPECTED RESULT
No memory leak

SOFTWARE/OS VERSIONS
Operating System: openSUSE Tumbleweed 20220426
KDE Plasma Version: 5.24.80
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.2
Kernel Version: 5.17.4-1-default (64-bit)
Graphics Platform: X11
Processors: 8 × AMD Ryzen 7 4700U with Radeon Graphics
Memory: 15.0 GiB of RAM
Graphics Processor: AMD RENOIR
Manufacturer: HP
Product Name: HP ZHAN 66 Pro A 14 G3
Comment 1 Fushan Wen 2022-05-16 06:55:05 UTC
Git commit 72a43783b5439637febfb20bbb70a0523fa9b9c7 by Fushan Wen, on behalf of David Edmundson.
Committed on 16/05/2022 at 06:55.
Pushed by fusionfuture into branch 'master'.

[ColumnView] Don't leak SeparatorItems

Any children from a created component must have either QML ownership or
a parent or manual destruction. Another code path in ColumnView can
delete separators at runtime so a parent is used.

M  +2    -0    src/columnview.cpp

https://invent.kde.org/frameworks/kirigami/commit/72a43783b5439637febfb20bbb70a0523fa9b9c7