Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
fixed small environment cleanup bug in Mojo::IOLoop::Server
  • Loading branch information
kraih committed Oct 23, 2011
1 parent 3e4499b commit af5528d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Changes
@@ -1,5 +1,8 @@
This file documents the revision history for Perl extension Mojolicious.

2.09 2011-10-23 00:00:00
- Fixed small environment cleanup bug in Mojo::IOLoop::Server.

2.08 2011-10-23 00:00:00
- Fixed a few more small test bugs.

Expand Down
3 changes: 2 additions & 1 deletion lib/Mojo/IOLoop/Server.pm
Expand Up @@ -74,6 +74,7 @@ has iowatcher => sub {

sub DESTROY {
my $self = shift;
if (my $port = $self->{port}) { $ENV{MOJO_REUSE} =~ s/(?:^|\,)$port\:\d+// }
if (my $cert = $self->{cert}) { unlink $cert if -w $cert }
if (my $key = $self->{key}) { unlink $key if -w $key }
return unless my $watcher = $self->{iowatcher};
Expand All @@ -88,7 +89,7 @@ sub listen {
my $args = ref $_[0] ? $_[0] : {@_};

# Look for reusable file descriptor
my $reuse = my $port = $args->{port} || 3000;
my $reuse = my $port = $self->{port} = $args->{port} || 3000;
$ENV{MOJO_REUSE} ||= '';
my $fd;
if ($ENV{MOJO_REUSE} =~ /(?:^|\,)$reuse\:(\d+)/) { $fd = $1 }
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious.pm
Expand Up @@ -35,7 +35,7 @@ has static => sub { Mojolicious::Static->new };
has types => sub { Mojolicious::Types->new };

our $CODENAME = 'Leaf Fluttering In Wind';
our $VERSION = '2.08';
our $VERSION = '2.09';

# "These old doomsday devices are dangerously unstable.
# I'll rest easier not knowing where they are."
Expand Down

0 comments on commit af5528d

Please sign in to comment.