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

[PATCH] git-gui: Fix the blame viewer destroy handler.

From
Alexander Gavrilov <angavrilov@gmail.com>
Date
Oct 3, 2008, 07:36 UTC
Message-ID
<1223019414-24643-3-git-send-email-angavrilov@gmail.com>
In-Reply-To
<1223019414-24643-1-git-send-email-angavrilov@gmail.com>

It did not delete the object, which is not very good. Also, destroy may be fired up for subwindows, so we should check %W.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---
	My own bug. I hope that now I understand
	Tcl better than 2 months ago.
	
	-- Alexander
 lib/blame.tcl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
diff --git a/lib/blame.tcl b/lib/blame.tcl
index a45784c..765d08c 100644
--- a/lib/blame.tcl
+++ b/lib/blame.tcl
@@ -377,11 +377,18 @@ constructor new {i_commit i_path i_jump} {
 	"if {{$w.file_pane} eq {%W}} {[cb _resize %h]}"
 
 	wm protocol $top WM_DELETE_WINDOW "destroy $top"
-	bind $top <Destroy> [cb _kill]
+	bind $top <Destroy> [cb _handle_destroy %W]
 
 	_load $this $i_jump
 }
 
+method _handle_destroy {win} {
+	if {$win eq $w} {
+		_kill $this
+		delete_this
+	}
+}
+
 method _kill {} {
 	if {$current_fd ne {}} {
 		kill_file_process $current_fd
-- 
1.6.0.20.g6148bc
Previous: Andreas Ericsson
Message 4 of 4 in “git-gui: Fix the blame window shape.”
  1. git-gui: Fix the blame window shape.Alexander Gavrilov, Oct 3, 2008
  2. git-gui: Add a search command to the blame viewer.Alexander Gavrilov, Oct 3, 2008
  3. Andreas EricssonOct 3, 2008
  4. git-gui: Fix the blame viewer destroy handler.Alexander Gavrilov, Oct 3, 2008

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.