git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[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
Previous: Markus HitterNext: Jacob Keller
Message 4 of 9 in “gitk: memory consumption improvements”
  1. 0/3 gitk: memory consumption improvementsMarkus Hitter, Nov 7, 2016
  2. 1/3 gitk: turn off undo manager in the text widgetMarkus Hitter, Nov 7, 2016
  3. 2/3 gitk: remove closed file descriptors from $blobdifffdMarkus Hitter, Nov 7, 2016
  4. 3/3 gitk: clear array 'commitinfo' on reloadMarkus Hitter, Nov 7, 2016
  5. Jacob KellerNov 7, 2016
  6. Junio C HamanoNov 8, 2016
  7. Markus HitterNov 9, 2016
  8. Junio C HamanoNov 9, 2016
  9. Paul MackerrasDec 12, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.