Skip to content

Commit 18ae912

Browse files
Traumflugpaulusmack
authored andcommitted
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 <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
1 parent 0748f41 commit 18ae912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gitk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ proc updatecommits {} {
588588
proc reloadcommits {} {
589589
global curview viewcomplete selectedline currentid thickerline
590590
global showneartags treediffs commitinterest cached_commitrow
591-
global targetid
591+
global targetid commitinfo
592592

593593
set selid {}
594594
if {$selectedline ne {}} {
@@ -609,6 +609,7 @@ proc reloadcommits {} {
609609
getallcommits
610610
}
611611
clear_display
612+
unset -nocomplain commitinfo
612613
unset -nocomplain commitinterest
613614
unset -nocomplain cached_commitrow
614615
unset -nocomplain targetid

0 commit comments

Comments
 (0)