--- deliantra/server/ext/login.ext 2007/06/10 03:11:16 1.49 +++ deliantra/server/ext/login.ext 2007/06/10 03:14:04 1.50 @@ -595,16 +595,13 @@ unless ($pl->active || $pl->ns) { # check refcounts, this is tricky and needs to be adjusted to fit server internals my $ob = $pl->ob; - Scalar::Util::weaken $pl; - Scalar::Util::weaken $ob; - my $a_ = $pl->refcnt;#d# - my $b_ = $ob->refcnt;#d# + my $pl_ref = $pl->refcnt_cnt; my $ob_ref = $ob->refcnt_cnt; - ## pl_ref == one from object + one from cf::PLAYER - ## ob_ref == one from simply being an object + one from pl->observe - if ($pl_ref == 2 && $ob_ref == 2) { + ## pl_ref == object + cf::PLAYER + $pl + ## ob_ref == being an object + pl->observe + $ob + if ($pl_ref == 3 && $ob_ref == 3) { warn "player-scheduler destroy ", $ob->name;#d# # remove from sight and get fresh "copies" @@ -614,6 +611,9 @@ $ob->destroy; $pl->destroy; } else { + my $a_ = $pl->refcnt;#d# + my $b_ = $ob->refcnt;#d# + warn "player-scheduler refcnt ", $ob->name, " pp$pl_ref,pc$a_ op$ob_ref,oc$b_\n";#d# } }