Skip to content

Commit

Permalink
fixed memory leak in Mojo::UserAgent::Server
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 26, 2014
1 parent 85db3b1 commit 920fb56
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Changes
Expand Up @@ -3,6 +3,7 @@
- Improved Mojo::IOLoop::Delay with circular reference protection.
- Improved Mojo::IOLoop::Delay to allow argument splicing.
- Improved Mojo::IOLoop::Server to reuse cipher list from IO::Socket::SSL.
- Fixed memory leak in Mojo::UserAgent::Server.

4.94 2014-04-20
- Added reverse_proxy attribute to Mojo::Server::Daemon.
Expand Down
2 changes: 2 additions & 0 deletions lib/Mojo/UserAgent/Server.pm
Expand Up @@ -3,6 +3,7 @@ use Mojo::Base -base;

use Mojo::IOLoop;
use Mojo::Server::Daemon;
use Scalar::Util 'weaken';

has ioloop => sub { Mojo::IOLoop->singleton };

Expand Down Expand Up @@ -36,6 +37,7 @@ sub _restart {
ioloop => $self->ioloop,
silent => 1
);
weaken $server->{app};
delete $self->{port} if $full;
die "Couldn't find a free TCP port for application.\n"
unless my $port = $self->{port} ||= Mojo::IOLoop->generate_port;
Expand Down

0 comments on commit 920fb56

Please sign in to comment.