projects
/
gitmo/Mouse.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
Add localization of $@ and $? in DESTROY
[gitmo/Mouse.git]
/
lib
/
Mouse
/
Meta
/
Method
/
Destructor.pm
diff --git
a/lib/Mouse/Meta/Method/Destructor.pm
b/lib/Mouse/Meta/Method/Destructor.pm
index
66f4709
..
28e260f
100644
(file)
--- a/
lib/Mouse/Meta/Method/Destructor.pm
+++ b/
lib/Mouse/Meta/Method/Destructor.pm
@@
-21,7
+21,17
@@
sub _generate_destructor{
my $source = sprintf("#line %d %s\n", __LINE__, __FILE__) . <<"...";
sub {
my \$self = shift;
- $demolishall;
+ local \$?;
+
+ my \$e = do{
+ local \$@;
+ eval{
+ $demolishall;
+ };
+ \$@;
+ };
+ no warnings 'misc';
+ die \$e if \$e; # rethrow
}
...