[poe-commits] SF.net SVN: poe: [2046] trunk/poe/lib/POE/Kernel.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2006-08-17 16:50:48
|
Revision: 2046 Author: rcaputo Date: 2006-08-17 09:50:42 -0700 (Thu, 17 Aug 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=2046&view=rev Log Message: ----------- Yuval Kogman discovered two problems in exception throwing for die() during _stop: Exceptions as overloaded objects would sometimes fail to be detected because they stringify to "". Exceptions during _stop would be handled by eval{} and never rethrown. Modified Paths: -------------- trunk/poe/lib/POE/Kernel.pm Modified: trunk/poe/lib/POE/Kernel.pm =================================================================== --- trunk/poe/lib/POE/Kernel.pm 2006-08-16 20:58:46 UTC (rev 2045) +++ trunk/poe/lib/POE/Kernel.pm 2006-08-17 16:50:42 UTC (rev 2046) @@ -990,7 +990,7 @@ # bit of a problem if an eval{} occurs here because a signal is # dispatched or something. - if ( $@ ne '' and !($type & ET_STOP) ) { + if (ref($@) or $@ ne '') { my $exception = $@; if(TRACE_EVENTS) { @@ -1000,28 +1000,31 @@ ); } - my $handled = $self->_dispatch_event( - $session, - $source_session, - EN_SIGNAL, - ET_SIGNAL, - [ - 'DIE' => { - source_session => $source_session, - dest_session => $session, - event => $event, - file => $file, - line => $line, - from_state => $fromstate, - error_str => $exception, - }, - ], - __FILE__, - __LINE__, - undef, - time(), - -__LINE__, - ); + my $handled; + if ($type & ~ET_STOP) { + $handled = $self->_dispatch_event( + $session, + $source_session, + EN_SIGNAL, + ET_SIGNAL, + [ + 'DIE' => { + source_session => $source_session, + dest_session => $session, + event => $event, + file => $file, + line => $line, + from_state => $fromstate, + error_str => $exception, + }, + ], + __FILE__, + __LINE__, + undef, + time(), + -__LINE__, + ); + } unless ($handled) { # Put our internal state back together before we throw the @@ -1031,7 +1034,6 @@ die( $exception ); } } - } else { if ($wantarray) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |