LoginSignup
1
0

More than 5 years have passed since last update.

global destruction まで残ってたらメモリリークじゃないの

Posted at
sub DESTROY {
    # Perl 5.14 以降なら ${^GLOBAL_PHASE} がある
    {
        local $@;
        eval { die };
        if ($@ =~ /during global destruction/) {
            warn "Possible memory leak detected";
        }
    }
}
1
0
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0