Author: spitzak
Date: 2007-06-11 14:26:31 -0400 (Mon, 11 Jun 2007)
New Revision: 5900
Log:
Fixed crash on OS/X when you destroyed a child window.
Modified:
trunk/src/Window.cxx
Modified: trunk/src/Window.cxx
===================================================================
--- trunk/src/Window.cxx 2007-06-10 21:27:33 UTC (rev 5899)
+++ trunk/src/Window.cxx 2007-06-11 18:26:31 UTC (rev 5900)
@@ -823,8 +823,17 @@
// remove from the list of windows:
CreatedWindow** pp = &CreatedWindow::first;
+#if USE_QUARTZ
+ // remove child/brother pointers as well...
+ for (; *pp; pp = &(*pp)->next) {
+ if ((*pp)->children == x) (*pp)->children = x->brother;
+ if ((*pp)->brother == x) (*pp)->brother = x->brother;
+ if (*pp == x) *pp = x->next;
+ }
+#else
for (; *pp != x; pp = &(*pp)->next) if (!*pp) return;
*pp = x->next;
+#endif
// recursively remove any subwindows:
for (CreatedWindow *x1 = CreatedWindow::first; x1;) {
_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit