1 |
--- lib/Mojo/IOLoop/Server.pm 2016-02-01 10:21:22.000000000 -0500 |
2 |
+++ lib/Mojo/IOLoop/Server.pm 2016-02-09 22:27:02.000000000 -0500 |
3 |
@@ -105,10 +105,11 @@ |
4 |
sub start { |
5 |
my $self = shift; |
6 |
weaken $self; |
7 |
+ return unless $self->reactor; |
8 |
$self->reactor->io($self->{handle} => sub { $self->_accept }); |
9 |
} |
10 |
|
11 |
-sub stop { $_[0]->reactor->remove($_[0]{handle}) } |
12 |
+sub stop { $_[0]->reactor->remove($_[0]{handle}) if $_[0]->reactor} |
13 |
|
14 |
sub _accept { |
15 |
my $self = shift; |
16 |
--- lib/Mojo/UserAgent.pm 2016-02-02 07:29:25.000000000 -0500 |
17 |
+++ lib/Mojo/UserAgent.pm 2016-02-09 22:30:19.000000000 -0500 |
18 |
@@ -266,6 +266,7 @@ |
19 |
sub _remove { |
20 |
my ($self, $id) = @_; |
21 |
my $c = delete $self->{connections}{$id}; |
22 |
+ return unless $c->{ioloop}; |
23 |
$self->_dequeue($c->{ioloop}, $id); |
24 |
$c->{ioloop}->remove($id); |
25 |
} |