@matheusbsbs / matheus-bagliano / commits / 580b73de25
Fork 0

git-gui: Fix bind errors when switching repository chooser panels

We need to remove any variable traces we may have installed when the panel is destroyed as the trace may attempt to use a widget that no longer exists on this panel. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Oct 12, 2007 at 11:15 UTC 580b73de258635ca392d917cda4341ac5f1a2535
1 file changed +6
lib/choose_repository.tcl
+6
@@ -352,6 +352,7 @@ method _do_new {} {
352 pack $w_body.where -fill x
353
354 trace add variable @local_path write [cb _write_local_path]
355 + bind $w_body.h <Destroy> [list trace remove variable @local_path write [cb _write_local_path]]
356 update
357 focus $w_body.where.t
358 }
@@ -477,6 +478,10 @@ method _do_clone {} {
478
479 trace add variable @local_path write [cb _update_clone]
480 trace add variable @origin_url write [cb _update_clone]
481 + bind $w_body.h <Destroy> "
482 + [list trace remove variable @local_path write [cb _update_clone]]
483 + [list trace remove variable @origin_url write [cb _update_clone]]
484 + "
485 update
486 focus $args.origin_t
487 }
@@ -948,6 +953,7 @@ method _do_open {} {
953 pack $w_body.where -fill x
954
955 trace add variable @local_path write [cb _write_local_path]
956 + bind $w_body.h <Destroy> [list trace remove variable @local_path write [cb _write_local_path]]
957 update
958 focus $w_body.where.t
959 }