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

If QFileDialog::getOpenFileName() is called in a button click event or other event, a dependent DLL will not unload

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.2.1
    • None
    • visual studio 2013, Window8.1 64 Bit, Qt5.2.1

    Description

      If I use QFileDialog::getOpenFileName(this), a dependent DLL will not unload. For example, assume there are two projects:

      1. Exe Project (Qt project)
      2. DLL Project, used by the Exe Project (implicitly linked)

      If the Exe Project uses the QFileDialog::getOpenFileName() in button click event or other event, the DLL will not unload.

      BOOL WINAPI DllMain(
        _In_  HINSTANCE hinstDLL,
        _In_  DWORD fdwReason,
        _In_  LPVOID lpvReserved
      )
      {
      	if (fdwReason == DLL_PROCESS_ATTACH)
      	{
      		//Load lib
      		int x = 100;
      	}
      	if (fdwReason == DLL_PROCESS_DETACH)
      	{
      		//UnLoad lib here not call when colse
      		int x = 100;
      	}
      	return TRUE;
      }
      

      And the DLL global var will not be destroyed.

      I've posted this problem in the forums: https://qt-project.org/forums/viewthread/40575/

      I've attached a test case.

      Thanks in advance.

      Attachments

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

        Activity

          People

            peppe Giuseppe D'Angelo
            iamxinbao XiongMao liu
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes