[Gambas-user] Ending processes after killing a gambas program

José Luis Redrejo jredrejo at ...626...
Fri Nov 9 14:39:30 CET 2007


Hello, I have a problem with a gambas application:
it starts some processes (using "Try myProcess=shell("whatever")"), don't
matter if I use shell or exec syntax.
My problem is that this gambas application has to run for the whole user
session, but should ends when the user logouts. The gambas application dies,
but the processes it starts continue as they are non-graphical processes.
Also if the user kills the gambas application or I just press the stop
button in the gambas ide, I have the same behaviour.


An example would be a form with only one button (Button1) and this code:

'------------------------
PRIVATE pro as Process

PUBLIC SUB Button1_Click()
   TRY pro=EXEC["gedit"]
END

PUBLIC SUB _free()
   TRY pro.Kill
END

'------------------------

Running this code inside the IDE, gedit will die if I click on the close
button of the form, but will remains active if I kill the gambas app, or
just click on the stop button of the IDE.

Up to now, that behaviour seems logical to me, but I would like to be able
to kill all the started processes when the application dies.
Any idea?



More information about the User mailing list