-
-
Save anonymous/05ed9acbd82e9e874f67 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/lib/Mojo/IOLoop/Stream.pm b/lib/Mojo/IOLoop/Stream.pm | |
index 8e86e77..1eca2f3 100644 | |
--- a/lib/Mojo/IOLoop/Stream.pm | |
+++ b/lib/Mojo/IOLoop/Stream.pm | |
@@ -15,7 +15,7 @@ sub close { | |
return unless my $reactor = $self->reactor; | |
return unless my $handle = delete $self->timeout(0)->{handle}; | |
$reactor->remove($handle); | |
- close $handle; | |
+ close $handle if $self->{pid} == $$; | |
$self->emit('close'); | |
} | |
@@ -39,7 +39,7 @@ sub is_writing { | |
return !!length($self->{buffer}) || $self->has_subscribers('drain'); | |
} | |
-sub new { shift->SUPER::new(handle => shift, buffer => '', timeout => 15) } | |
+sub new { shift->SUPER::new(handle => shift, buffer => '', timeout => 15, pid => $$) } | |
sub start { | |
my $self = shift; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment