Skip to content
Browse files

Use Devel::GlobalDestruction to avoid trying to detach scopes during …

…shutdown
  • Loading branch information...
1 parent f05975b commit aeb569aa9f4bef3c637280646aa0ba38e3e7927a @clintongormley committed Aug 4, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 lib/Elastic/Model/Scope.pm
View
2 lib/Elastic/Model/Scope.pm
@@ -4,6 +4,7 @@ use Moose;
use namespace::autoclean;
use MooseX::Types::Moose qw(:all);
use Scalar::Util qw(refaddr);
+use Devel::GlobalDestruction;
#===================================
has '_objects' => (
@@ -103,6 +104,7 @@ sub delete_object {
sub DEMOLISH {
#===================================
my $self = shift;
+ return if in_global_destruction;
$self->model->detach_scope($self);
}

0 comments on commit aeb569a

Please sign in to comment.
Something went wrong with that request. Please try again.