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

Access Violation when clearing clipboard when mimedata was set in DLL used via LoadLibrary

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Out of scope
    • Affects Version/s: 5.12.2, 5.12.3
    • Fix Version/s: None
    • Component/s: GUI: Drag and Drop
    • Labels:
      None
    • Environment:
      Windows 10, x64, msvc2017
    • Platform/s:
      Windows

      Description

      Placing something on clipboard in a DLL which is used in QApplication via LoadLibrary produces access violation when QApplication is destroyed because it clears the clipboard.

      Clearing clipboard before FreeLibrary is called, removes AV, however is not desired in my case. I need the data on clipbard retained after FreeLibrary is called.

      QByteArray xml;
      QMimeData* mimedata = new QMimeData();
      mimedata->setData("lasernet/xmltransformeractionslist", xml);
      QApplication::clipboard()->setMimeData(mimedata);
      

      If I add dependency to DLL and not using Load/FreeLibrary there is not problem, but I cannot do this in this case since DLL is a plugin that may or may not be used.

      Steps to reproduce:

      Run the attached project. Add -w as a command line argument for a workaround. Crash does not occur with MinGW.

        Attachments

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

          Activity

            People

            Assignee:
            kleint Friedemann Kleint
            Reporter:
            bleze Jacob Pedersen
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes