Browse Source

* lib/Selenium/Client.pm (DESTROY): Localize $? to prevent it from affecting the
exit status when wait is called.

Chris Faylor 4 years ago
parent
commit
ae8abc3b1a
1 changed files with 2 additions and 0 deletions
  1. 2 0
      lib/Selenium/Client.pm

+ 2 - 0
lib/Selenium/Client.pm

@@ -343,6 +343,8 @@ sub _wait ($self) {
 sub DESTROY($self) {
     return unless $self->{auto_close};
 
+    local $?; # Avoid affecting the exit status
+
     print "Shutting down active sessions...\n" if $self->{debug};
     #murder all sessions we spawned so that die() cleans up properly
     if ($self->{ua} && @{$self->{sessions}}) {