title: QProcess causes memory leak
body: <p>I'm building a C++/Qt5.1 app which uses QProcess to launch another program, then wait for the result.  Every time I run this code, valgrind says memory is lost on line 2 (the start line).</p>
  
  <pre><code>QProcess command(this);
  command.start(commandpath, myParameters);
  if (command.waitForStarted(waitToStart)) {
      command.write(myStdIn.toLatin1());
      command.closeWriteChannel();
      if (command.waitForFinished(waitToFinish)) {
          myStdOut = command.readAllStandardOutput();
          myStdErr = command.readAllStandardError();
      }
  }
  command.deleteLater();
  </code></pre>
  
  <p>I added the deletelater() line but it doesn't help.  (Note that the memory loss only occurs if the 'commandpath' program doesn't run successfully - for example, when I try to run a non-existant program).</p>
  
  <p>Can someone explain why, and how to resolve this memory loss?</p>
  
  <p>Here's some valgrind output if that helps:</p>
  
  <pre><code>16 bytes in 1 blocks are definitely lost in loss record 57 of 678
    in RunProcessWorker::run(RunProcessWorker::EMutex, QString, QString, QString, bool, QString, QStringList, QStringList, QString, QString&amp;amp;, QString&amp;amp;, unsigned int, unsigned int, unsigned long long&amp;amp;, RunProcessWorker::EResultCodes&amp;amp;, QProcess::ProcessError&amp;amp;, int&amp;amp;) in /mnt/lserver2/data/development/haast/src/systemcommands/runprocessworker.cpp:249
    1: operator new[](unsigned long) in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so
    2: /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5.1.0
    3: QProcess::open(QFlags&amp;lt;QIODevice::OpenModeFlag&amp;gt;) in /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5.1.0
    4: QProcess::start(QString const&amp;amp;, QStringList const&amp;amp;, QFlags&amp;lt;QIODevice::OpenModeFlag&amp;gt;) in /opt/Qt5.1.0/5.1.0/gcc_64/lib/libQt5Core.so.5.1.0
    5: RunProcessWorker::run(RunProcessWorker::EMutex, QString, QString, QString, bool, QString, QStringList, QStringList, QString, QString&amp;amp;, QString&amp;amp;, unsigned int, unsigned int, unsigned long long&amp;amp;, RunProcessWorker::EResultCodes&amp;amp;, QProcess::ProcessError&amp;amp;, int&amp;amp;) in &lt;a href="file:///mnt/lserver2/data/development/haast/bin/debug/../../src/systemcommands/runprocessworker.cpp:249" &gt;/mnt/lserver2/data/development/haast/src/systemcommands/runprocessworker.cpp:249&lt;/a&gt;
  </code></pre>