Workaround for double-call of destructors (based on 3d56e026 and e1d9e578)
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / CDBICompat / DestroyWarning.pm
CommitLineData
c0e7b4e5 1package # hide from PAUSE
2 DBIx::Class::CDBICompat::DestroyWarning;
a3018bd3 3
4use strict;
5use warnings;
d63c9e64 6use DBIx::Class::_Util 'detected_reinvoked_destructor';
7use namespace::clean;
a3018bd3 8
9sub DESTROY {
d63c9e64 10 return if &detected_reinvoked_destructor;
11
a3018bd3 12 my ($self) = @_;
13 my $class = ref $self;
14 warn "$class $self destroyed without saving changes to "
15 .join(', ', keys %{$self->{_dirty_columns} || {}})
16 if keys %{$self->{_dirty_columns} || {}};
17}
18
191;