Das führt zu Duplizierungen von Singletons, in diesem Fall der
Datenbankverbindung die dann beim abbauen kaputtgehen.
(cherry picked from commit
9a86234c1a5624573a3f2738cf25b526527796c8)
Behebt #358 (redmine).
use parent qw(Rose::Object);
-use Clone qw(clone);
use SL::File::Backend;
use SL::File::Object;
use SL::DB::History;
for my $version (2..$maxversion) {
$main::lxdebug->message(LXDebug->DEBUG2(), "clone for version=".($maxversion-$version+1));
eval {
- my $clone = clone($fileobj);
+ my $clone = $fileobj->clone;
$clone->version($maxversion-$version+1);
$clone->newest(0);
$main::lxdebug->message(LXDebug->DEBUG2(), "clone version=".$clone->version." mtime=". $clone->mtime);
$_[0]->db_file;
}
+sub clone {
+ bless +{ %{ $_[0] } }, __PACKAGE__;
+}
+
sub init_db_file { die 'must always have a db file'; }
sub init_loaded { 0 }