PDA

View Full Version : QPluginLoader question



QPlace
29th July 2007, 10:54
Question1: When QPluginloader member function instance() returns pointer to the interface of the plugin - should this pointer be deleted when I call unload()?

Question2: In general, when I stuff the pointers to the root interface of plugins in the container such as QList, and then I would like to reload plugins - what should be done with these pointers?

Question3: QPluginLoader class has a pointer to a private class that I can't find the implementation of. It is supposed to be platform-specfiic and therefore the implementation is hidden in the static libs of QT, isn't it?

fullmetalcoder
29th July 2007, 11:16
You need not bother with deleting this pointer AFAIK. Especially if you call unload() by hand... This pointer is not allocated on heap but points to a static variable stored in the plugin so deleting it is likely to do harm
Clearer explanation of the design involved would be necessary to answer this one...
The implementation is in the sources but as with every other pimpl in Qt the headers of this class are not installed... Besides, they can frequently change from version to version (even patch) since they do not break the binary compat so trying to use them would be foolhardy...