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

launched QProcess on windows inherits handles, when started detached

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 6.8.3, 6.8.4
    • Core: Other
    • None
    • Windows
    • Windows

    Description

      Launching a setup.exe (by example) whch updates a Qt app (auto-update), even if the app directly exists upon the setup launch produced locked files the setup was unable to overwrite.
      This was due to a strange default behavior of the QProcess startDetached() : 

      QProcess process;

      process.setProgram("setup.exe");

      I had to add this line : 

      #ifdef Q_OS_WIN

      {{ process.setCreateProcessArgumentsModifier([](QProcess::CreateProcessArguments *args) { args->inheritHandles = false; });}}

      #endif

       

      So maybe default behavior is not the correct one on Windows...

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            AlGrenadine Alexandre GRANVAUD
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes