[SOLVED] program crash when restart a process
i’m sorry if i start a topic wich is allready on this forum, but i couldn’t find it.
I have a problem when i try to restart the program that’s already started from my program.
this is my simple code:
As you can see, i just trying the code wich is provided by the class explanation on
1.The first time i click the button, rythmbox starts without a problem.
2.Then i close rythmbox.
3. Then i press the button for a second time and the program crashed.
I get this output:
- Starting 'path to'/prob...
- The program has unexpectedly finished.
- 'path to'/prob exited with code 0
As you can see, i don’t get an error, but it stops unexpectedly.
Does somebody knows, why this is hapening?
parent is an uninitialized pointer. It contains any arbitrary value, but does not point to a QObject. Either call QProcess’ constructor with “this” as parent or with “0” as parent (but, in the latter case, do not forget to delete the object when you’re done with it, otherwise you will have a memory leak)
thanks for your help, but i still got a question:
i don’t use the qobject parent, as you suggested
and this works!!
But you told me to delete the process.
what is the place i would do that?