Code

Kill the blame back-end on window close.
[git.git] / lib / blame.tcl
index 192505d983030c04f2153de9ac33709663fca7f1..2c190482df10dafb9bcef8116ea42c931d553efb 100644 (file)
@@ -326,19 +326,27 @@ constructor new {i_commit i_path} {
        bind $w.file_pane <Configure> \
        "if {{$w.file_pane} eq {%W}} {[cb _resize %h]}"
 
+       wm protocol $top WM_DELETE_WINDOW "destroy $top"
+       bind $top <Destroy> [cb _kill]
+
        _load $this {}
 }
 
+method _kill {} {
+       if {$current_fd ne {}} {
+               kill_file_process $current_fd
+               catch {close $current_fd}
+               set current_fd {}
+       }
+}
+
 method _load {jump} {
        variable group_colors
 
        _hide_tooltip $this
 
        if {$total_lines != 0 || $current_fd ne {}} {
-               if {$current_fd ne {}} {
-                       catch {close $current_fd}
-                       set current_fd {}
-               }
+               _kill $this
 
                foreach i $w_columns {
                        $i conf -state normal