Skip to content

Commit

Permalink
Make it so that irc_shutdown is always the last event to be sent
Browse files Browse the repository at this point in the history
  • Loading branch information
hinrik committed Apr 17, 2011
1 parent b6c97e9 commit f437fa8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions Changes
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ Revision history for Perl extension POE::Component::IRC.
{{$NEXT}}
- The changes to the filter test were causing failures on <5.12 due to
C<values(ARRAY)>. Fixed it.
- Make it so that irc_shutdown is always the last event to be sent

6.60 Fri Apr 15 06:12:28 GMT 2011
- Fix failure (RT #67465) related to the recent irc_snotice change.
Expand Down
11 changes: 6 additions & 5 deletions lib/POE/Component/IRC.pm
Original file line number Diff line number Diff line change
Expand Up @@ -244,13 +244,14 @@ sub _parseline {
return;
}

# the public interface
sub send_event {
my ($self, @args) = @_;
$poe_kernel->call($self->{SESSION_ID} => __send_event => @args);
return 1;
}

# Hack to make plugin_add/del send events from OUR session
# Hack to make sure events are sent from OUR session
sub __send_event {
my ($self, $event, @args) = @_[OBJECT, ARG0..$#_];
# Actually send the event...
Expand Down Expand Up @@ -1185,15 +1186,15 @@ sub _cleanup {
my $sender_id = delete $self->{_shutdown};
$kernel->sig('POCOIRC_REGISTER');
$kernel->sig('POCOIRC_SHUTDOWN');

# Delete all plugins that are loaded.
$self->_pluggable_destroy();

$self->_send_event(irc_shutdown => $sender_id);
$self->_unregister_sessions();
$kernel->alarm_remove_all();
$kernel->alias_remove($_) for $kernel->alias_list($session);
delete $self->{$_} for qw(socketfactory dcc wheelmap);

# Delete all plugins that are loaded.
$self->_pluggable_destroy();

$self->{resolver}->shutdown() if $self->{resolver} && $self->{mydns};

return;
Expand Down

0 comments on commit f437fa8

Please sign in to comment.