projects
/
gitmo/Mouse.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(parent:
6475f69
)
Support the global destruction flag in DEMOLISH()
gfx [Wed, 10 Feb 2010 08:13:50 +0000 (17:13 +0900)]
lib/Mouse/Meta/Method/Destructor.pm
patch
|
blob
|
blame
|
history
lib/Mouse/PurePerl.pm
patch
|
blob
|
blame
|
history
xs-src/Mouse.xs
patch
|
blob
|
blame
|
history
diff --git
a/lib/Mouse/Meta/Method/Destructor.pm
b/lib/Mouse/Meta/Method/Destructor.pm
index
1d08ac0
..
d083a6b
100644
(file)
--- a/
lib/Mouse/Meta/Method/Destructor.pm
+++ b/
lib/Mouse/Meta/Method/Destructor.pm
@@
-13,7
+13,8
@@
sub _generate_destructor{
my $demolishall = '';
for my $class ($metaclass->linearized_isa) {
if (Mouse::Util::get_code_ref($class, 'DEMOLISH')) {
- $demolishall .= "${class}::DEMOLISH(\$self);\n";
+ $demolishall .= sprintf "%s::DEMOLISH(\$self, \$Mouse::Util::in_global_destruction);\n",
+ $class,
}
}
diff --git
a/lib/Mouse/PurePerl.pm
b/lib/Mouse/PurePerl.pm
index
f6c5e5b
..
802289d
100644
(file)
--- a/
lib/Mouse/PurePerl.pm
+++ b/
lib/Mouse/PurePerl.pm
@@
-627,7
+627,7
@@
sub DESTROY {
my $demolish = Mouse::Util::get_code_ref($class, 'DEMOLISH')
|| next;
- $self->$demolish();
+ $self->$demolish($Mouse::Util::in_global_destruction);
}
};
$@;
diff --git
a/xs-src/Mouse.xs
b/xs-src/Mouse.xs
index
34ba351
..
86b7896
100644
(file)
--- a/
xs-src/Mouse.xs
+++ b/
xs-src/Mouse.xs
@@
-650,6
+650,7
@@
CODE:
PUSHMARK(SP);
XPUSHs(object);
+ XPUSHs(boolSV(PL_dirty));
PUTBACK;
call_sv(AvARRAY(demolishall)[i], G_VOID | G_EVAL);