From: Vincent Pit Date: Sun, 22 Feb 2009 11:08:30 +0000 (+0100) Subject: A note on global destruction and free callbacks X-Git-Tag: v0.32~13 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=a7d4b31f4786fe41cd52432d97ce50186fee7d2e;p=perl%2Fmodules%2FVariable-Magic.git A note on global destruction and free callbacks --- diff --git a/lib/Variable/Magic.pm b/lib/Variable/Magic.pm index ac1f806..45ba9b5 100644 --- a/lib/Variable/Magic.pm +++ b/lib/Variable/Magic.pm @@ -293,6 +293,8 @@ However, only the return value of the C callback currently holds a meaning. set => sub { print STDERR "set to ${$_[0]}\n" }, free => sub { print STDERR "${$_[0]} was deleted\n" } +Note that C callbacks are I called during global destruction, as there's no way to ensure that the wizard and the C coderef weren't destroyed before the scalar. + =cut sub wizard {