This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[patch] memwin race condition


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
 }
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]