gitk: Clear array 'commitinfo' on reload
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>
Markus Hitter committed
Nov 7, 2016 at 19:02 UTC
18ae912082736b4c2c596b2c5bdcf2e032a03467
1 file changed
+2
-1
gitk
+2
-1
@@ -588,7 +588,7 @@ proc updatecommits {} {
588
proc reloadcommits {} {
589
global curview viewcomplete selectedline currentid thickerline
590
global showneartags treediffs commitinterest cached_commitrow
591
- global targetid
591
+ global targetid commitinfo
592
593
set selid {}
594
if {$selectedline ne {}} {
@@ -609,6 +609,7 @@ proc reloadcommits {} {
609
getallcommits
610
}
611
clear_display
612
+ unset -nocomplain commitinfo
613
unset -nocomplain commitinterest
614
unset -nocomplain cached_commitrow
615
unset -nocomplain targetid