Hi all,

I am trying to make an application (for windows) which can be updated by replacing the dll library at run-time, problem is that the exe seems to keep the dll file locked after unloading.

What I'm trying to do in code:
Qt Code:
  1. QLibrary* Lib = new QLibrary("library");
  2. if(!Lib->load()) {
  3. qDebug() << mainLib->errorString();
  4. }
  5. ...
  6. if( Lib->unload() ) {
  7. delete Lib;
  8. QFile::remove(libraryPath) //fails as file is locked :(
  9. }
To copy to clipboard, switch view to plain text mode 
I've checked that the dll file is closed (process monitor, sysinternals) when trying to remove.

Does anybody know if this is something which can't be done by qLibrary, a Windows probem or whether an app restart is required?