Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-23324

QLibrary's unload work incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 5.2.0
    • 4.7.4
    • Core: Other
    • None
    • Windows 7

    Description

      1/ If there is a dll been loaded, I want to unload it. I have to write code like below:
      QLibrary lib(path);
      if (lib.load())
      lib.unload();
      I don't know why I should load it first.

      2/ the dll does not unload immediately

      3/ User can't handle load reasons like thread attach or detach

      this solution works correctly on windows
      on the place you want to load:
      HMODULE pHnd = LoadLibraryW((wchar_t*)QDir::toNativeSeparators(path).utf16());
      if (!pHnd)

      { return; }

      DisableThreadLibraryCalls(pHnd);

      on the place you want to unload:
      FreeLibrary((HMODULE)pHnd);

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            thiago Thiago Macieira
            robotr Robot.R
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes