--- deliantra/server/ext/login.ext 2007/01/07 21:54:59 1.12 +++ deliantra/server/ext/login.ext 2007/01/08 12:23:32 1.15 @@ -160,6 +160,7 @@ my $pl = cf::player::find $user or next; $pl->connect ($ns); check_clean_save $pl; + $pl->{clean_save} = 1; last; } elsif (can_cleanup $buf, $mtime) { Coro::Timer::sleep 1; @@ -293,7 +294,7 @@ return cf::override 0 unless $ob->type == cf::PLAYER; - my $pl = $ob->pl; + my $pl = $ob->contr; # update respawn position $pl->savebed ($bed->map->path, $bed->x, $bed->y); @@ -309,10 +310,7 @@ $pl->deactivate; $pl->ns->destroy; } else { - cf::async { - $pl->{clean_save} = 1; - $pl->save; - }; + cf::async { $pl->save }; } }); }, @@ -367,6 +365,14 @@ $pl->save; Coro::Timer::sleep $SAVE_INTERVAL; } + my $ob = $pl->ob; + Scalar::Util::weaken $pl; # 2 == from object + from perl + Scalar::Util::weaken $ob; # 2 == one from being an object + ??? + my $a_ = $pl->refcnt; + my $b_ = $ob->refcnt; + my $a = $pl->refcnt_cnt; + my $b = $ob->refcnt_cnt; + warn "rc $a,$a_ $b,$b_\n";#d# }; warn $@ if $@; Coro::cede;