[Gambas-user] Propper way to kill a runnin process

M0E Lnx m0e.lnx at ...626...
Mon Mar 10 14:54:25 CET 2008


Sorry, hit the send button by accident... here it is

I have on my vpackager application one shell process that run on
several stages. I have a function that constantly checks the output of
this process for "keywords" that if found, need to immediately kill
the process. Here is how I'm killing the process

PUBLIC SUB ABORT_PROCESS()
IF instr(sBuffer, "FAILED") > 0 THEN
  IF hMyProc.State = Process.Running THEN
   hMyProc.kill
  END IF
END IF
END

The problem is that altough on the screen it appears the sub run
without error, I can still feel the CPU is running... I can hear it
too. My system monitor shows high CPU useage even after the code has
ran.
Is there another way to do this more accurately?

Using gambas2-2.0.0
Thanks


On 3/10/08, M0E Lnx <m0e.lnx at ...626...> wrote:
> I have on my vpackager application one shell process that run on
>  several stages. I have a function that constantly checks the output of
>  this process for "keywords" that if found, need to immediately kill
>  the process. Here is how I'm killing the process
>
>  PUBLIC SUB ABORT_PROCESS()
>  IF instr(sBuffer, "FAILED") > 0 THEN
>    IF hMyProc.State = Process.Running THEN
>




More information about the User mailing list