Commit e0957a79 authored by Michael Gray's avatar Michael Gray
Browse files

Tidy up in Z:Context, avoiding potential callback circular references with Connection.

parent 91d69346
......@@ -80,6 +80,14 @@ sub init {
return;
}
sub close {
my ($self) = @_;
$self->zircon_trace;
$self->context->close if ($self->context);
delete $self->{'context'};
return;
}
# client
sub send {
......@@ -297,6 +305,7 @@ sub state {
sub DESTROY {
my ($self) = @_;
$self->zircon_trace('%s', $self);
$self->close if $self->context;
return;
}
......
......@@ -77,6 +77,14 @@ sub transport_init {
return;
}
sub close {
my ($self) = @_;
$self->zircon_trace;
$self->_request_callback(undef);
$self->_after_request_callback(undef);
return;
}
sub _send_msg {
my ($self, $msg, $socket, $flags) = @_;
......@@ -628,6 +636,7 @@ sub disconnect {
sub DESTROY {
my ($self) = @_;
$self->zircon_trace('%s', $self);
$self->close;
$self->disconnect;
return;
}
......
......@@ -313,6 +313,7 @@ sub close {
my ($self) = @_;
$self->zircon_trace;
$self->callback(undef);
$self->connection->close if $self->connection;
delete $self->{'connection'};
$self->{'is_open'} = 0;
return;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment