summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Hitter <mah@jump-ing.de>2016-11-07 16:01:17 +0100
committerPaul Mackerras <paulus@ozlabs.org>2016-12-12 20:39:37 +1100
commit0748f41eb83194dbc310fe47b4948f611ac5b3a2 (patch)
treef6916c3417f2476527a9e46905433cac13b270bf
parent106a6d9d85ead187f8b1be64b7a8dbf19a128743 (diff)
downloadgit-0748f41eb83194dbc310fe47b4948f611ac5b3a2.tar.gz
gitk: Remove closed file descriptors from $blobdifffd
One shouldn't have descriptors of already closed files around. The first idea to deal with this (previously) ever growing array was to remove it entirely, but it's needed to detect start of a new diff with ths old diff not yet done. This happens when a user clicks on the same commit in the commit list repeatedly without delay. Signed-off-by: Markus Hitter <mah@jump-ing.de> Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
-rwxr-xr-xgitk5
1 files changed, 5 insertions, 0 deletions
diff --git a/gitk b/gitk
index 08ff7ceb2b..e037a755a5 100755
--- a/gitk
+++ b/gitk
@@ -8073,7 +8073,11 @@ proc getblobdiffline {bdf ids} {
$ctext conf -state normal
while {[incr nr] <= 1000 && [gets $bdf line] >= 0} {
if {$ids != $diffids || $bdf != $blobdifffd($ids)} {
+ # Older diff read. Abort it.
catch {close $bdf}
+ if {$ids != $diffids} {
+ array unset blobdifffd $ids
+ }
return 0
}
parseblobdiffline $ids $line
@@ -8082,6 +8086,7 @@ proc getblobdiffline {bdf ids} {
blobdiffmaybeseehere [eof $bdf]
if {[eof $bdf]} {
catch {close $bdf}
+ array unset blobdifffd $ids
return 0
}
return [expr {$nr >= 1000? 2: 1}]