Permalink
Browse files

Fix $@ getting clobbered

At least for some versions of Perl, likely all pre 5.16, in DESTROY,
a local $@ is always advisable, such as to not clobber a previously
raised exception.
  • Loading branch information...
1 parent 375eae9 commit d99c728b5422915c143b52f7cabae9d7d20e8e67 Max Maischein committed Mar 16, 2012
Showing with 4 additions and 0 deletions.
  1. +3 −0 Changes
  2. +1 −0 lib/MozRepl/RemoteObject.pm
View
@@ -8,6 +8,9 @@ To-do:
. Automatically load the AnyEvent backend if needed.
. Implement ->can() for MozRepl objects
+0.30 201203xx
+ ! Fix a destructor clobbering $@ indirectly
+ This led to $@ being empty even though an exception was thrown.
0.29 20111222
. This version is mostly a cleanup version with clearer failure
diagnostics. If MozRepl::RemoteObject is currently working for you,
@@ -666,6 +666,7 @@ sub queued {
sub DESTROY {
my ($self) = @_;
+ local $@;
#warn "Repl cleaning up";
delete @{$self}{ qw( constants functions callbacks )};
if ($self->{use_queue} and $self->queue and @{ $self->queue }) {

0 comments on commit d99c728

Please sign in to comment.