Skip to content

Commit

Permalink
Add the finalized-ok return value to _data_ses_finalize, so we can
Browse files Browse the repository at this point in the history
test that the final state of the subsystem is consistent.
  • Loading branch information
rcaputo committed Jun 2, 2003
1 parent 7379cc9 commit c9ca560
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions lib/POE/Resource/Sessions.pm
Expand Up @@ -45,17 +45,19 @@ use POE::API::ResLoader \&_data_ses_initialize;
### End-run leak checking.

sub _data_ses_finalize {
# Don't bother if run() was never called. -><- Is this needed?
# return unless $kr_run_warning & KR_RUN_CALLED;
my $finalized_ok = 1;

while (my ($ses, $ses_rec) = each(%kr_sessions)) {
$finalized_ok = 0;
warn( "!!! Leaked session: $ses\n",
"!!!\trefcnt = $ses_rec->[SS_REFCOUNT]\n",
"!!!\tparent = $ses_rec->[SS_PARENT]\n",
"!!!\tchilds = ", join("; ", keys(%{$ses_rec->[SS_CHILDREN]})), "\n",
"!!!\tprocs = ", join("; ", keys(%{$ses_rec->[SS_PROCESSES]})),"\n",
);
}

return $finalized_ok;
}

### Enter a new session into the back-end stuff.
Expand Down Expand Up @@ -92,9 +94,13 @@ sub _data_ses_allocate {
}
}

### Release a session's resources, and remove it. This doesn't do
### garbage collection for the session itself because that should
### already have happened.
# Release a session's resources, and remove it. This doesn't do
# garbage collection for the session itself because that should
# already have happened.
#
# -><- This is yet another place where resources will need to register
# a function. Every resource's _data_???_clear_session is called
# here.

sub _data_ses_free {
my ($self, $session) = @_;
Expand Down

0 comments on commit c9ca560

Please sign in to comment.