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

Daniel Campos dcamposf at ...626...
Fri Nov 9 15:01:27 CET 2007


PUBLIC SUB _free()
    TRY EXEC["kill","-9",pro.Id]
 END

2007/11/9, José Luis Redrejo <jredrejo at ...626...>:
> 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?
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems?  Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>




More information about the User mailing list