title: How to destroy QProcess when it finishes and the class than contaed the slot
body: <p>I start a <code>QProcess</code> in member function of a class but that object (Pdf object below) will soon get destroyed after creating the process. I obviously want the slot function to be available and called when QProcess finishes. I pass <code>QProcess</code> pointer so when it finishes, it will destroy it as well. But actually it doesn't really is destroyed when it finishes.</p>
  
  <pre><code>void PDf::createPDF()
  {
  PdfSymlink * pdfSymlink = new PdfSymlink( fileName, linkName, myProcess );
  
  connect(myProcess, SIGNAL(finished(int)), pdfSymlink, SLOT(createPdfLink(int)) );
  
  myProcess-&gt;start("sh",args); // args is defined now shown in code
  } 
  </code></pre>
  
  <p>This is a repetitive code which is called many many timesI want the QProcess to get destroyed when it finishes and likewise pdfSymlink should be destroyed as well. How can I do that?</p>
  
  <p>Note my slot does get called and it does the job but I want to make sure I clean up after this object.</p>