I start a QProcess
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 QProcess
pointer so when it finishes, it will destroy it as well. But actually it doesn't really is destroyed when it finishes.
void PDf::createPDF()
{
PdfSymlink * pdfSymlink = new PdfSymlink( fileName, linkName, myProcess );
connect(myProcess, SIGNAL(finished(int)), pdfSymlink, SLOT(createPdfLink(int)) );
myProcess->start("sh",args); // args is defined now shown in code
}
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?
Note my slot does get called and it does the job but I want to make sure I clean up after this object.