… | |
… | |
2414 | |
2414 | |
2415 | die $$res unless "ARRAY" eq ref $res; |
2415 | die $$res unless "ARRAY" eq ref $res; |
2416 | |
2416 | |
2417 | return wantarray ? @$res : $res->[-1]; |
2417 | return wantarray ? @$res : $res->[-1]; |
2418 | } else { |
2418 | } else { |
|
|
2419 | local $SIG{__WARN__}; |
2419 | eval { |
2420 | eval { |
2420 | local $SIG{__DIE__}; |
2421 | local $SIG{__DIE__}; |
2421 | local $SIG{__WARN__}; |
|
|
2422 | close $fh1; |
2422 | close $fh1; |
2423 | |
2423 | |
2424 | my @res = eval { $cb->(@args) }; |
2424 | my @res = eval { $cb->(@args) }; |
2425 | syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res); |
2425 | syswrite $fh2, Coro::Storable::freeze +($@ ? \"$@" : \@res); |
2426 | }; |
2426 | }; |
2427 | |
2427 | |
|
|
2428 | warn $@ if $@; |
2428 | _exit 0; |
2429 | _exit 0; |
2429 | } |
2430 | } |
2430 | } |
2431 | } |
2431 | |
2432 | |
2432 | |
2433 | |
… | |
… | |
2700 | Symbol::delete_package "safe::$_" |
2701 | Symbol::delete_package "safe::$_" |
2701 | for qw(cf::attachable cf::object cf::object::player cf::client cf::player cf::map cf::party cf::region); |
2702 | for qw(cf::attachable cf::object cf::object::player cf::client cf::player cf::map cf::party cf::region); |
2702 | |
2703 | |
2703 | warn "unloading cf.pm \"a bit\""; |
2704 | warn "unloading cf.pm \"a bit\""; |
2704 | delete $INC{"cf.pm"}; |
2705 | delete $INC{"cf.pm"}; |
|
|
2706 | delete $INC{"cf/pod.pm"}; |
2705 | |
2707 | |
2706 | # don't, removes xs symbols, too, |
2708 | # don't, removes xs symbols, too, |
2707 | # and global variables created in xs |
2709 | # and global variables created in xs |
2708 | #Symbol::delete_package __PACKAGE__; |
2710 | #Symbol::delete_package __PACKAGE__; |
2709 | |
2711 | |