[Qt-interest] QtGui4.dll and QtCore4.dll don't unload, when using QFileSystemModel!
Niels Dekker - no return address
noreply at this.is.invalid
Tue Aug 18 16:17:16 CEST 2009
Scott Aron Bloom wrote:
> What you are probably seeing, is that QT's gui and core libraries have
> static global objects. Which even when you unload what you are
> actually using (the model) the statics are still around, and thus the
> core and gui DLLs don't unload.
Thanks, Scott. So is there any way to deallocate those statics, and
unload QtGui4.dll and QtCore4.dll, when our "OurWidget.dll", which
loaded those Qt DLL's, is also unloading?
Note that even when a QFileSystemModel object is *only* declared
(without using it), those Qt DLL's don't unload anymore automatically:
// When user presses this button, QtGui4.dll and QtCore4.dll
// will remain in memory, even when OurWidget.dll is unloaded:
void OurWidget::on_pushButton_clicked()
{
QFileSystemModel dummy;
}
Kind regards, Niels
> -----Original Message-----
> From: qt-interest-bounces at trolltech.com
> [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Niels Dekker -
> no return address
> Sent: Tuesday, August 18, 2009 3:08 AM
> To: qt-interest at trolltech.com
> Subject: [Qt-interest] QtGui4.dll and QtCore4.dll don't unload,when
> using QFileSystemModel!
>
> We're developing a DLL, "OurWidget.dll", containing a widget derived
> from a Qt4 QMainWindow. The user of the DLL does not need to use Qt
> directly. MFC applications and console applications can just link to
> "OurWidget.dll", which will indirectly load the necessary Qt DLL's:
> QtGui4.DLL, QtCore4.dll, and QtXml4.dll. Our widget has a tree view,
> ourTreeView, which may have a model of type QFileSystemModel.
>
> Now when our widget has indeed used a QFileSystemModel while it is
> loaded, "QtGui4.DLL" and "QtCore4.dll" will not unload anymore,
> afterwards! Not even when the "OurWidget.dll" is unloaded!
> ("QtXml4.dll" is unloaded properly, though.) Moreover, the
> application may become unstable afterwards!
>
> Is this a known issue of QFileSystemModel? Is there a workaround?
>
> We're using Qt 4.5.2, and our "OurWidget.dll" links at compile-time
> ("early binding") to QtGui4.lib, QtCore4.lib, and QtXml4.lib. We
> monitored loading and unloading of DLL's by Dependency Walker
> (www.dependencywalker.com).
>
> Hope you can help,
>
> Niels
More information about the Qt-interest-old
mailing list