]> Dogcows Code - chaz/p5-File-KDBX/blobdiff - lib/File/KDBX/Safe.pm
Save stream offset in safe to fix locked peeking
[chaz/p5-File-KDBX] / lib / File / KDBX / Safe.pm
index 0e445c619154f95692be39b24062fbc150c8a500..e8b5fd94963b8ee3835da4e7fb6d2a9a4acdc280 100644 (file)
@@ -48,7 +48,7 @@ sub new {
     return $self;
 }
 
-sub DESTROY { !in_global_destruction and $_[0]->unlock }
+sub DESTROY { local ($., $@, $!, $^E, $?); !in_global_destruction and $_[0]->unlock }
 
 =method clear
 
@@ -151,7 +151,7 @@ sub add_protected {
     @strings or throw 'Must provide strings to lock';
 
     for my $string (@strings) {
-        my $item = {str => $string};
+        my $item = {str => $string, off => $self->{counter}};
         $item->{filter} = $filter if defined $filter;
         if (is_scalarref($string)) {
             next if !defined $$string;
This page took 0.020083 seconds and 4 git commands to generate.