[Qt-interest] QFileIconProvider "leaks" DLL's (qgifd4.dll, qicod4.dll, QtSvgd4.dll, etc.)
Niels Dekker - no return address
noreply at this.is.invalid
Thu Aug 20 11:55:14 CEST 2009
>> Note also that both Windows and Linux use a reference-counting
>> mechanism to keep a dynamic library loaded as long as at least
>> one component still has the library in use.
Thiago Macieira wrote:
> That's the low-level stuff. But there's no reference counting for each
> image type. You can also note that Qt loads all the imageformat
> plugins,
> even if it just needs one of them.
Do you mean that Qt could also improve its performance by loading only
the plugins it really needs?
> Should we load the plugins, read the image and then unload? So if you
> have to read 200 images from a directory, should we load and unload
> 200 times? Otherwise, how long should we keep the plugins? As long as
> there's an image in memory?
I think these are very good questions. It may be useful to have a
mechanism to keep those plugins loaded while reading a bunch of images.
But I think there should also be a way to unload the plugins, when the
reading is done. Do you think the plugins should still be loaded when
qApp is already destructed?
>> I would find it disappointing if Qt would leak resources of our
>> users, just to do some other users a very minor favor. Especially
>> because there does not seem to be a workaround for us.
>
> I would too. Fortunately, there's no leak in this case.
What do you mean, "there's no leak"???
We have an MFC application. While it's running, the user may choose to
select a menu item to pop up a widget. Which loads "OurWidget.dll".
Thereby, various Qt DLL's are loaded automatically. When the user
closes the dialog, "OurWidget.dll" is unloaded. But most of the Qt DLL's
remain loaded. Including the plugins and QtGui4.dll. Even when the user
does not use anything based on Qt afterwards. Don't you think that's a
leak?
>> Does QFileSystemModel need to have those plugins? Do we need to have
>> them installed at the machine of our users, in order to properly use
>> QFileSystemModel within our application?
>
> I think the filesystem model loads icons for the file types. If you
> don't have the image plugins, then it will only be able to deal with
> builtin image formats (XPM and PNG).
Thanks, Thiago.
>> At the moment, our application appears unstable, when it's using
>> QFileSystemModel on a machine that does not have the plugins. Is
>> that a
>> known issue?
>
> No.
Thanks. I think I'll start a new thread on the stability issue.
Kind regards, Niels
More information about the Qt-interest-old
mailing list