gitk: Clear array 'commitinfo' on reload
authorMarkus Hitter <mah@jump-ing.de>
Mon, 7 Nov 2016 18:02:51 +0000 (19:02 +0100)
committerPaul Mackerras <paulus@ozlabs.org>
Mon, 12 Dec 2016 09:39:37 +0000 (20:39 +1100)
After a reload we might have an entirely different set of commits,
so keeping all of them leaks memory. Remove them all because
re-creating them is not more expensive than testing wether they're
still valid. Lazy (re-)creation is already well established, so
a missing entry can't cause harm.

Signed-off-by: Markus Hitter <mah@jump-ing.de>
Signed-off-by: Paul Mackerras <paulus@ozlabs.org>
gitk
diff --git a/gitk b/gitk
index e037a755a513ded085ff7c81551e935085cf8d26..07e21d42de42d4506a616957328ddca47cc5375b 100755 (executable)
--- a/gitk
+++ b/gitk
@@ -588,7 +588,7 @@ proc updatecommits {} {
 proc reloadcommits {} {
     global curview viewcomplete selectedline currentid thickerline
     global showneartags treediffs commitinterest cached_commitrow
-    global targetid
+    global targetid commitinfo
 
     set selid {}
     if {$selectedline ne {}} {
@@ -609,6 +609,7 @@ proc reloadcommits {} {
        getallcommits
     }
     clear_display
+    unset -nocomplain commitinfo
     unset -nocomplain commitinterest
     unset -nocomplain cached_commitrow
     unset -nocomplain targetid