Use svn pools to solve the memory leak problem.
Signed-off-by: Yaacov Akiba Slama <ya@slamail.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Yaacov Akiba Slama committed
Nov 2, 2005 at 23:51 UTC
fcfa32b9e10b3c0373a263a732146850bdf67242
1 file changed
+6
-2
git-svnimport.perl
+6
-2
@@ -112,7 +112,9 @@ sub file {
112
DIR => File::Spec->tmpdir(), UNLINK => 1);
113
114
print "... $rev $path ...\n" if $opt_v;
115
- eval { $self->{'svn'}->get_file($path,$rev,$fh); };
115
+ my $pool = SVN::Pool->new();
116
+ eval { $self->{'svn'}->get_file($path,$rev,$fh,$pool); };
117
+ $pool->clear;
118
if($@) {
119
return undef if $@ =~ /Attempted to get checksum/;
120
die $@;
@@ -674,7 +676,9 @@ sub commit_all {
676
}
677
678
while(++$current_rev <= $svn->{'maxrev'}) {
677
- $svn->{'svn'}->get_log("/",$current_rev,$current_rev,$current_rev,1,1,\&_commit_all,"");
679
+ my $pool=SVN::Pool->new;
680
+ $svn->{'svn'}->get_log("/",$current_rev,$current_rev,1,1,1,\&_commit_all,$pool);
681
+ $pool->clear;
682
commit_all();
683
if($opt_l and not --$opt_l) {
684
print STDERR "Stopping, because there is a memory leak (in the SVN library).\n";