Skip to content

Commit

Permalink
Fixed recursive calls on disconnect
Browse files Browse the repository at this point in the history
  • Loading branch information
vti committed Jun 22, 2011
1 parent 23f1a68 commit cc08943
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
11 changes: 6 additions & 5 deletions lib/PocketIO/Connection.pm
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,12 @@ sub disconnected {

$self->{is_connected} = 0;

$self->on('disconnect')->($self);
$self->{disconnect_timer} = AnyEvent->timer(
after => 0,
cb => sub {
$self->on('disconnect')->($self);
}
);

return $self;
}
Expand Down Expand Up @@ -299,10 +304,6 @@ sub _parse_data {
return;
}

sub DESTROY {
DEBUG && warn "Connection destroyed\n";
}

1;
__END__
Expand Down
4 changes: 0 additions & 4 deletions lib/PocketIO/Handle.pm
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,6 @@ sub close {
return $self;
}

sub DESTROY {
DEBUG && warn "Handle destroyed\n";
}

1;
__END__
Expand Down

0 comments on commit cc08943

Please sign in to comment.