[Qt-interest] QFileIconProvider "leaks" DLL's (qgifd4.dll, qicod4.dll, QtSvgd4.dll, etc.)
Thiago Macieira
thiago.macieira at trolltech.com
Tue Aug 18 20:31:02 CEST 2009
Em Terça-feira 18 Agosto 2009, às 19:20:24, Niels Dekker - no return address
escreveu:
> QFileIconProvider loads some DLL files that aren't unloaded anymore.
> When I step over the QFileIconProvider constructor in the debugger (MSVC
> 2008), I get the following debug output:
>
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qgifd4.dll'
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qicod4.dll'
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qjpegd4.dll'
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qmngd4.dll'
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qsvgd4.dll'
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\bin\QtSvgd4.dll', Symbols loaded.
> 'Foo.exe': Loaded 'C:\Qt\4.5.2\plugins\imageformats\qtiffd4.dll'
>
> Those DLL's remain in memory, and thereby, QtGui4.DLL and QtCore4.dll
> also remain there. Is that a bug? Shouldn't the destructor of
> QFileIconProvider unload those DLL's? Or should I unload those DLL's
> myself, after using QFileIconProvider, in my own code? (If so, how
> should I do so?)
>
> It appears that the DLL's are loaded inside QFileIconProviderPrivate(),
> when it does:
> trashcan = style->standardIcon(QStyle::SP_TrashIcon);
> (In "C:\Qt\4.5.2\src\gui\itemviews\qfileiconprovider.cpp")
Those are standard Qt plugins. They are loaded by the QImageReader class, when
trying to parse icon images.
They should get unloaded automatically when QtCore is unloaded.
You're saying that QtGui isn't unloaded because those plugins are still
loaded. But the plugins only get unloaded when QtCore is unloaded.
So, chicken and the egg problem.
No solution that I can think of.
--
Thiago Macieira - thiago.macieira (AT) nokia.com
Senior Product Manager - Nokia, Qt Development Frameworks
Sandakerveien 116, NO-0402 Oslo, Norway
Qt Developer Days 2009 | Registration Now Open!
Munich, Germany: Oct 12 - 14 San Francisco, California: Nov 2 - 4
http://qt.nokia.com/qtdevdays2009
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090818/8c9c49c2/attachment.bin
More information about the Qt-interest-old
mailing list