destroy#
Release the native context attached to a Digest::SHA object.
The Perl destructor. Invoked automatically when the last reference to a Digest::SHA object goes out of scope - you do not normally call it yourself. It frees the heap-allocated hashing context behind the blessed reference.
Σύνοψη#
{
my $sha = Digest::SHA->new(256);
# ... use $sha ...
} # DESTROY runs here when $sha leaves scope
Τι επιστρέφεται#
Nothing. DESTROY returns to Perl with no value.
Παραδείγματα#
my $sha = Digest::SHA->new(256);
undef $sha; # triggers DESTROY
## Double-free safety: explicit DESTROY followed by scope exit is harmless.
my $sha = Digest::SHA->new(256);
$sha->DESTROY;
## automatic DESTROY on scope exit is a no-op after the explicit call
Οριακές περιπτώσεις#
Calling
DESTROYon an object that is not a blessedDigest::SHAreference is silently ignored.After
DESTROY, the object’s internal pointer is zeroed, so repeated calls are safe.
Διαφορές από το upstream#
Fully compatible with upstream Digest::SHA 6.04.
Δείτε επίσης#
new- counterpart: allocates the context thatDESTROYreleases.clone- each clone also owns a context and is destroyed independently.