[Interest] QLibrary multiple loading

alex at golks.de alex at golks.de
Tue Nov 4 10:04:02 CET 2014


 

> Serge K <gourmand at inbox.ru> hat am 4. November 2014 um 09:35 geschrieben:
> 
>  As I know from docs and my own experience QLibrary loads each DLL only once.
> While next load attempt it just increases usage counter. This means all DLL’s
> static data are loaded only once too. But I need allow different threads load
> each own copy of DLL with it’s own copy of static data. Otherwise all data in
> DLL become shared between threads which I do not need. I need force each
> loaded DLL copy work as “object” with it’s own static data set. Now I
> dynamically create numbered copies of DLL files but this is not elegant
> solution. Is there any way to force QLibrary load DLL from same file but to
> separate memory as it would be loaded from separate file? Important – I make
> crossplatform application, it must work in Windows and Linux at least.
> 
> 
>  --
>  Serge K
> 
 
Hi,
 
i think you should look into the factory pattern.
i normally export a
  ClassFromDll* createInstance();
or alike, to create distinct instances of my data from a single dll.
 
besides, i don't know if this is possible the way you want.
 
alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141104/84aecb6c/attachment.html>


More information about the Interest mailing list