--- deliantra/Deliantra-Client/DC.pm 2006/08/14 04:34:40 1.114 +++ deliantra/Deliantra-Client/DC.pm 2006/09/20 16:01:07 1.120 @@ -15,7 +15,7 @@ package CFPlus; BEGIN { - $VERSION = '0.2'; + $VERSION = '0.52'; use XSLoader; XSLoader::load "CFPlus", $VERSION; @@ -71,7 +71,12 @@ sub put($$$) { my ($db, $key, $data) = @_; - $DB_SYNC{$db} = AnyEvent->timer (after => 5, cb => sub { $db->db_sync }); + my $hkey = $db + 0; + Scalar::Util::weaken $db; + $DB_SYNC{$hkey} ||= AnyEvent->timer (after => 5, cb => sub { + delete $DB_SYNC{$hkey}; + $db->db_sync if $db; + }); $db->db_put ($key => $data) } @@ -291,7 +296,8 @@ my ($entry, $txt) = @_; $::CONN->send ("mark ". pack "N", $self->{tag}); $::CONN->send ("command rename to <$txt>"); - }); + }, $self->{name}, + "If you input no name or erase the current custom name, the custom name will be unset"); } ], ["apply", sub { $::CONN->send ("apply $self->{tag}") }],