This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[patch] memwin race condition
- From: "Martin M. Hunt" <hunt at redhat dot com>
- To: Insight Mailing List <insight at sources dot redhat dot com>
- Date: Fri, 11 Jan 2002 15:57:33 -0800
- Subject: [patch] memwin race condition
- Organization: Red Hat Inc
Another trivial patch. Under certain conditions, the memory window's
idle hook is called before it is fully created. This is not important,
but check for this so the idle hook doesn't generate an error message.
--
Martin Hunt
GDB Engineer
Red Hat, Inc.
2002-01-11 Martin M. Hunt <hunt@redhat.com>
* library/memwin.itb (idle): Check for existence of window.
Prevents race-condition error.
Index: library/memwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/memwin.itb,v
retrieving revision 1.13
diff -u -p -r1.13 memwin.itb
--- memwin.itb 2001/12/18 21:35:56 1.13
+++ memwin.itb 2002/01/11 23:34:37
@@ -386,17 +386,19 @@ body MemWin::idle {event} {
# Cursor
cursor {}
- # Enable menus
- if {$mbar} {
- for {set i 0} {$i <= [$itk_interior.m.addr index last]} {incr i} {
- if {[$itk_interior.m.addr type $i] != "separator"} {
- $itk_interior.m.addr entryconfigure $i -state normal
- }
+ if {[winfo exists $itk_interior.m.addr]} {
+ # Enable menus
+ if {$mbar} {
+ for {set i 0} {$i <= [$itk_interior.m.addr index last]} {incr i} {
+ if {[$itk_interior.m.addr type $i] != "separator"} {
+ $itk_interior.m.addr entryconfigure $i -state normal
+ }
}
+ }
+
+ # Enable control
+ $itk_interior.f.cntl configure -state normal
}
-
- # Enable control
- $itk_interior.f.cntl configure -state normal
}