[Qt-interest] How to stop threads started by QFileSystemModel (QFileInfoGatherer, QWindowsFileSystemWatcherEngine)?

Niels Dekker - no return address noreply at this.is.invalid
Thu Aug 20 13:10:02 CEST 2009


Our code basically does:

  QFileSystemModel* fileSystemModel = new QFileSystemModel();
  treeView->setModel(fileSystemModel);

Within the constructor of QFileSystemModel, a thread is created 
('QFileInfoGatherer'). During the lifetime of fileSystemModel, some 
other threads are created, including 'QWindowsFileSystemWatcherEngine'. 
Unfortunately the destructor of QFileSystemModel doesn't delete those 
threads. Is that a bug?

Anyway, it appears that those threads cause a crash of our application, 
because they keep running, even when qApp is destructed and Qt's DLL's 
are unloaded. Is there a way to stop the threads created by 
QFileSystemModel?

Kind regards, Niels

P.S. This question is related to the thread I started two days ago, 
"QtGui4.dll and QtCore4.dll don't unload, when using QFileSystemModel!", 
http://lists.trolltech.com/pipermail/qt-interest/2009-August/011488.html 
Thanks for all your feedback so far!

--
Niels Dekker
http://www.xs4all.nl/~nd/dekkerware
Scientific programmer at LKEB, Leiden University Medical Center 




More information about the Qt-interest-old mailing list