当前位置: 代码迷 >> QT开发 >> Qt中动态调用dll后,怎么释放dll
  详细解决方案

Qt中动态调用dll后,怎么释放dll

热度:356   发布时间:2016-04-25 05:13:03.0
Qt中动态调用dll后,如何释放dll?
QLibrary mylib("aaa.dll"); 
if (mylib.load())  
{  
  //创建一个dll对象,将其放入一个窗口中
}  
 
当我关闭窗口的时候,如何释放dll呢?
ps:当我load两次dll的时候,关闭窗口时,就会报错:“Unhandled exception at 0x02938c13 in XXX.exe: 0xC0000005: Access violation reading location 0xfeeefefa.”
求高手,求解释,求解决。。。。

------解决方案--------------------

bool QLibrary::unload ()
Unloads the library and returns true if the library could be unloaded; otherwise returns false.
This happens automatically on application termination, so you shouldn't normally need to call this function.
If other instances of QLibrary are using the same library, the call will fail, and unloading will only happen when every instance has called unload().
Note that on Mac OS X 10.3 (Panther), dynamic libraries cannot be unloaded.
  相关解决方案