Permalink
Browse files

Use memory cleanly.

  • Loading branch information...
1 parent c9285dd commit c6355157b6d4a99b48fe093dd0b212d0a6b2aec8 @hiratara committed Sep 29, 2009
Showing with 6 additions and 1 deletion.
  1. +6 −1 lib/Chaberi/Backdoor/LoadMembers.pm
@@ -72,7 +72,10 @@ sub load {
Chaberi::AnyEvent::Lobby::connect
address => $self->host,
port => $self->port,
- sub { $self->on_connect(@_); },
+ sub {
+ $self->on_connect(@_);
+ undef $self;
+ },
;
};
@@ -85,6 +88,7 @@ sub on_connect {
ref_room_ids => $self->room_ids,
cb => sub {
$self->recieve_members(@_);
+ undef $self;
},
);
};
@@ -102,6 +106,7 @@ sub recieve_members {
;
# close lobby
+ $self->lobby->shutdown;
$self->lobby( undef );
};

0 comments on commit c635515

Please sign in to comment.