[poe-commits] SF.net SVN: poe: [2048] trunk/poe/lib/POE/Resource/Sessions.pm
Brought to you by:
rcaputo
From: <rc...@us...> - 2006-08-19 22:23:59
|
Revision: 2048 Author: rcaputo Date: 2006-08-19 15:23:54 -0700 (Sat, 19 Aug 2006) ViewCVS: http://svn.sourceforge.net/poe/?rev=2048&view=rev Log Message: ----------- Don't allow _data_ses_stop() to stop a session currently being stopped. This is needed for proper exception handling in _stop handlers, otherwise infinite recursion happens. That's bad. Modified Paths: -------------- trunk/poe/lib/POE/Resource/Sessions.pm Modified: trunk/poe/lib/POE/Resource/Sessions.pm =================================================================== --- trunk/poe/lib/POE/Resource/Sessions.pm 2006-08-19 22:19:44 UTC (rev 2047) +++ trunk/poe/lib/POE/Resource/Sessions.pm 2006-08-19 22:23:54 UTC (rev 2048) @@ -447,9 +447,17 @@ # Dispatch _stop to a session, removing it from the kernel's data # structures as a side effect. +my %already_stopping; + sub _data_ses_stop { my ($self, $session) = @_; + # Don't stop a session that's already in the throes of stopping. + # This can happen with exceptions, during die() in _stop. It can + # probably be removed if exceptions are. + return if exists $already_stopping{$session}; + $already_stopping{$session} = 1; + if (ASSERT_DATA) { _trap("stopping a nonexistent session") unless exists $kr_sessions{$session}; @@ -509,6 +517,8 @@ unless (keys %kr_sessions) { $self->loop_halt(); } + + delete $already_stopping{$session}; } 1; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |