[PATCH 3/3] gitk: clear array 'commitinfo' on reload
- From
Markus Hitter <mah@jump-ing.de>
- Date
- Nov 7, 2016, 19:03 UTC
- Message-ID
- <2cb7f76f-0004-a5b6-79f1-9bb4f979cf14@jump-ing.de>
- In-Reply-To
- <8e1c5923-d2a6-bc77-97ab-3f154b41d2ea@jump-ing.de>
From 8359452f426c68cc02250f25f20eaaacd2ddd001 Mon Sep 17 00:00:00 2001 From: Markus Hitter <mah@jump-ing.de> Date: Mon, 7 Nov 2016 19:02:51 +0100 Subject: [PATCH 3/3] 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> --- gitk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gitk b/gitk index 518a4ce..aef6db6 100755 --- 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
-- 2.9.3