[Bps-public-commit] brackup branch, master, updated. 98e86321eef84f38420ccb7ab56760a5d4fcc657

Thomas Sibley trs at bestpractical.com
Thu Apr 4 16:16:57 EDT 2013

The branch, master has been updated
       via  98e86321eef84f38420ccb7ab56760a5d4fcc657 (commit)
      from  4d172c9edcdc3f5a8e2d6aada1b590d2613f5040 (commit)

Summary of changes:
 lib/Brackup/GPGProcManager.pm | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

- Log -----------------------------------------------------------------
commit 98e86321eef84f38420ccb7ab56760a5d4fcc657
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Thu Apr 4 12:53:41 2013 -0700

    Remove GPG chunk tempfiles after they're used instead of at global destruction
    Active GPGProcess objects are keyed by the PositionedChunk address, not
    their own address.  This bug left dangling references to GPGProcess
    objects which in turn kept references to their File::Temp object,
    causing any GPG-encrypted content to collect on disk until global
    process destruction.  Rather than passing the pchunk to
    get_proc_chunkref, simply move the delete up into the caller which
    already manages $self->{procs}.
    This restores the original behaviour (and current code's intent)

diff --git a/lib/Brackup/GPGProcManager.pm b/lib/Brackup/GPGProcManager.pm
index 1e4b0f8..da73467 100644
--- a/lib/Brackup/GPGProcManager.pm
+++ b/lib/Brackup/GPGProcManager.pm
@@ -44,6 +44,7 @@ sub enc_chunkref_of {
     my ($cref, $enc_length) = $self->get_proc_chunkref($proc);
+    delete $self->{procs}{$pchunk};
@@ -90,7 +91,6 @@ sub next_chunk_to_encrypt {
 sub get_proc_chunkref {
     my ($self, $proc) = @_;
     my $cref = $proc->chunkref;
-    delete $self->{procs}{$proc};
     $self->{uncollected_bytes} -= $proc->size_on_disk;
     return ($cref, $proc->size_on_disk);


More information about the Bps-public-commit mailing list