From: Chris Nehren Date: Fri, 15 Apr 2011 03:59:48 +0000 (-0400) Subject: fix DESTROY method now that processes are spawned with Child.pm X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=fbd64e21e4893c5f772807187a9bc993953ccd8c;p=scpubgit%2FTest-Harness-Selenium.git fix DESTROY method now that processes are spawned with Child.pm --- diff --git a/lib/Test/Harness/Selenium.pm b/lib/Test/Harness/Selenium.pm index fa7130b..39721f7 100644 --- a/lib/Test/Harness/Selenium.pm +++ b/lib/Test/Harness/Selenium.pm @@ -134,8 +134,12 @@ sub get_rows_for { sub DESTROY { my($self) = @_; - if(exists $self->{xvnc_pid}) { - kill("KILL", $self->{xvnc_pid}); + if(exists $self->{selenium_rc}{xvnc_server_proc} and + exists $self->{selenium_rc}{selenium_server_proc}) { + $self->{selenium_rc}{xvnc_server_proc}->complete || + $self->{selenium_rc}{xvnc_server_proc}->kill("KILL"); + $self->{selenium_rc}{selenium_server_proc}->complete || + $self->{selenium_rc}{selenium_server_proc}->kill("KILL"); } }