[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSWindow mishandles fieldEditor when dealloc:ing

From: Alexander Malmberg
Subject: NSWindow mishandles fieldEditor when dealloc:ing
Date: Mon, 04 Mar 2002 00:38:06 +0100


If an NSWindow is dealloc:ed with an active field editor the field
editor isn't removed from the window (although it is released). (This
causes a crash if the field editor had a blinking cursor; when the timer
fires it will try to tell the now-dealloc:ed superview to redraw
itself.) I've attached a patch that calls removeFromSuperview before
releasing the fieldEditor when dealloc:ing the window.

- Alexander Malmberg
Index: NSWindow.m
RCS file: /cvsroot/gnustep/gnustep/core/gui/Source/NSWindow.m,v
retrieving revision 1.222
diff -u -r1.222 NSWindow.m
--- NSWindow.m  2 Mar 2002 07:23:18 -0000       1.222
+++ NSWindow.m  3 Mar 2002 23:30:28 -0000
@@ -613,7 +613,11 @@
      retained for some other reason by the programmer or by other
      parts of the code */
-  TEST_RELEASE(_fieldEditor);
+  if (_fieldEditor)
+  {
+    [_fieldEditor removeFromSuperview];
+    TEST_RELEASE(_fieldEditor);
+  }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]