Subject: | [Patch] Don't remove alias until child has been shut down |
alias_remove is being called too soon. If I want to find out if an
EasyDBI session has really been shut down, the alias_remove call needs
to be moved to after the child has been reaped. Patch is attached.
Subject: | alias-remove.patch |
Index: lib/POE/Component/EasyDBI.pm
===================================================================
--- lib/POE/Component/EasyDBI.pm (revision 37)
+++ lib/POE/Component/EasyDBI.pm (working copy)
@@ -318,11 +318,6 @@
DEBUG && warn 'Duplicate shutdown NOW fired!';
return;
}
- } else {
- # Remove our alias so we can be properly terminated
- $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne '');
- # and the child
- $kernel->sig( 'CHLD' );
}
# Check if we got "NOW"
@@ -946,8 +948,17 @@
}
sub sig_child {
- delete $_[HEAP]->{wheel_pid};
- $_[KERNEL]->sig_handled();
+ my ($kernel, $heap) = @_[KERNEL, HEAP];
+
+ delete $heap->{wheel_pid};
+ $kernel->sig_handled();
+
+ if ( $heap->{shutdown} ) {
+ # Remove our alias so we can be properly terminated
+ $kernel->alias_remove($heap->{alias}) if ($heap->{alias} ne '');
+ # and the child
+ $kernel->sig( 'CHLD' );
+ }
}
# ----------------