Skip to content

Commit

Permalink
weaken should be closer to the closure
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Nov 20, 2015
1 parent d53773a commit bc8ea4e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Mojo/Server/Daemon.pm
Expand Up @@ -228,10 +228,10 @@ sub _write {
my $stream = $self->ioloop->stream($id)->write($chunk);

# Finish or continue writing
weaken $self;
my $next = '_write';
$tx->has_subscribers('finish') ? ($next = '_finish') : $self->_finish($id)
if $tx->is_finished;
weaken $self;
$stream->write('' => sub { $self->$next($id) });
}

Expand Down

0 comments on commit bc8ea4e

Please sign in to comment.