[poe-commits] poe/POE Kernel.pm,1.210,1.211
Brought to you by:
rcaputo
From: <rc...@us...> - 2002-10-03 12:43:20
|
Update of /cvsroot/poe/poe/POE In directory usw-pr-cvs1:/tmp/cvs-serv23154/POE Modified Files: Kernel.pm Log Message: Add TRACE_RELATIONS, and move extra-reference garbage collection so that it doesn't trigger a duplicate _stop event *from* a _stop event. This clears up the last of the known bugs introduced by accessorizing POE::Kernel's internal structures. Index: Kernel.pm =================================================================== RCS file: /cvsroot/poe/poe/POE/Kernel.pm,v retrieving revision 1.210 retrieving revision 1.211 diff -C2 -d -r1.210 -r1.211 *** Kernel.pm 3 Oct 2002 06:55:25 -0000 1.210 --- Kernel.pm 3 Oct 2002 12:43:17 -0000 1.211 *************** *** 222,226 **** define_trace ! qw(EVENTS GARBAGE PROFILE QUEUE REFCOUNT RETURNS SELECT SIGNALS ADHOC); # See the notes for TRACE_DEFAULT, except read ASSERT and assert --- 222,228 ---- define_trace ! qw( EVENTS GARBAGE PROFILE QUEUE REFCOUNT RETURNS SELECT SIGNALS ADHOC ! RELATIONS ! ); # See the notes for TRACE_DEFAULT, except read ASSERT and assert *************** *** 342,346 **** unless (keys %{$kr_extra_refs{$session}}) { delete $kr_extra_refs{$session}; - $self->_data_ses_collect_garbage($session); } } --- 344,347 ---- *************** *** 419,423 **** sub _data_sid_set { my ($self, $sid, $session) = @_; - #cluck "+++++ $session = $sid"; $kr_session_ids{$sid} = $session; $kr_session_to_id{$session} = $sid; --- 420,423 ---- *************** *** 429,433 **** my ($self, $session) = @_; my $sid = delete $kr_session_to_id{$session}; - #cluck "----- $session = $sid"; confess "internal inconsistency" unless defined $sid; delete $kr_session_ids{$sid}; --- 429,432 ---- *************** *** 1604,1607 **** --- 1603,1607 ---- confess "parent $parent does not exist" unless exists $kr_sessions{$parent}; + TRACE_RELATIONS and warn "<pc> session $session has parent $parent"; $kr_sessions{$parent}->[SS_CHILDREN]->{$session} = $session; $self->_data_ses_refcount_inc($parent); *************** *** 1637,1640 **** --- 1637,1642 ---- confess "internal inconsistency ($parent/$session)" unless delete $kr_sessions{$parent}->[SS_CHILDREN]->{$session}; + undef $kr_sessions{$session}->[SS_PARENT]; + TRACE_RELATIONS and cluck "<pc> removed $session from $parent"; $self->_data_ses_refcount_dec($parent); *************** *** 1692,1702 **** --- 1694,1708 ---- # Remove the session from its old parent. delete $kr_sessions{$old_parent}->[SS_CHILDREN]->{$session}; + TRACE_RELATIONS and warn "<pc> removed $session from $old_parent"; $self->_data_ses_refcount_dec($old_parent); # Change the session's parent. $kr_sessions{$session}->[SS_PARENT] = $new_parent; + TRACE_RELATIONS and warn "<pc> changed parent of $session to $new_parent"; # Add the current session to the new parent's children. $kr_sessions{$new_parent}->[SS_CHILDREN]->{$session} = $session; + TRACE_RELATIONS and warn "<pc> added $session to $new_parent"; + $self->_data_ses_refcount_inc($new_parent); } *************** *** 3460,3463 **** --- 3466,3471 ---- my $refcount = $self->_data_extref_dec($session, $tag); + $self->_data_ses_collect_garbage($session); + # trace it here return $refcount; |