Unload Qlibrary
-
Hi,
I'm using a DLL with QLibrary in order to control a machine.
I load the library and resole functions.
Then i call an init() function from the library.When the machine is not detected on the network, this function return -1 and i can't unload the library. I close all the windows and the app crash fiew seconds later.
Thx for help
-
Hi
You should be able to call
http://doc.qt.io/qt-5/qlibrary.html#unload
if you are the only instance using the DLL.
Else You cannot unload it.Also
"Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded." -
Hi,
I'm using a DLL with QLibrary in order to control a machine.
I load the library and resole functions.
Then i call an init() function from the library.When the machine is not detected on the network, this function return -1 and i can't unload the library. I close all the windows and the app crash fiew seconds later.
Thx for help
@Zoptune Why does it crash? What does the debugger say?
-
Hi
You should be able to call
http://doc.qt.io/qt-5/qlibrary.html#unload
if you are the only instance using the DLL.
Else You cannot unload it.Also
"Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded." -
I think I'm the only instance using the DLL
When the machine is detected on the network, unload work fine. -
@Zoptune Why does it crash? What does the debugger say?
@Wieland
When the machine is not detected, my app is useless. So i just close it.
Closing my app call the unload function in an object destructor.
Then i quit and wait the thread where the DLL was used and stop the app.But when all windows are closed and app seems to be stoped, i don't have any message like :
PATH\debug\test.exe exited with code 0
4 or 5 seconds later i have the message :
PATH\debug\test.exe crashed
-
@Zoptune
Ok. it sounds like the DLL does something in init() when it fails.
You need to look at that code to know. -
@Zoptune
Oh. It seems that on fail (-1), it might spawn something or
be in funny state so it sounds like its still active
when App is closed.What DLL is it?
-
Hi,
Out of curiosity, why not link your application to that library ? Or do you only got the .dll file ?
-
Hi,
Out of curiosity, why not link your application to that library ? Or do you only got the .dll file ?
-
Hi,
they gave you the DLL and the documentation. So you could ask them about the error.
-Michael. -
@m.sue
I send them an email.I created this topic to ask if it was possible that the problem came from my side.