Details
-
Bug
-
Resolution: Done
-
P2: Important
-
4.5.3, 4.6.0
-
None
-
Mac OSX Leopard
-
-
b2e5e2158529f49390ec597cda823c72336b23ff
Description
The Mac OSX Carbon implementation leaks memory if a QMainWindow is decorated via setWindowIcon(), the icon is not freed if the window is destroyed.
compile/run the attached application and watch the memory usage with the Activity Monitor: The memory quickly grows in 200k steps.
The reason is that the mac specific 'windowIcon' member is not freed in the destructor, it should be probably done in
void QWidgetPrivate::deleteTLSysExtra() via 'ReleaseIconRef'.
One can measure this pretty accurate with the help of the Mac OSX malloc env helpers
% MallocStackLogging=1 ./qt4iconbug.app/Contents/MacOS/qt4iconbug
% heap qt4iconbug>1.log;sleep 5;heap qt4iconbug>2.log
with 'malloc_history" one can also immediately see that the biggest memory consumer is the icon.
As a workaround if I use setWindowIcon(emptyIcon) before deleting the toplevel widget, the leaking is greatly reduced
(but still there is a memory increase due to smaller leaks in the svg routines)
Kind Regards, Leo