Author: manolo
Date: 2011-03-25 16:17:16 -0700 (Fri, 25 Mar 2011)
New Revision: 8534
Log:
Fix STR #2595. Mac OS. When deleting a subwindow, don't delete the Cocoa window 
(xid) attached to it because it is in fact the Cocoa window of its parent 
window.
I check that by making sure that none of the windows in the window list uses
this Cocoa window. Is there a better algorithm ?

Modified:
   branches/branch-1.3/src/Fl_cocoa.mm

Modified: branches/branch-1.3/src/Fl_cocoa.mm
===================================================================
--- branches/branch-1.3/src/Fl_cocoa.mm 2011-03-25 12:31:51 UTC (rev 8533)
+++ branches/branch-1.3/src/Fl_cocoa.mm 2011-03-25 23:17:16 UTC (rev 8534)
@@ -2573,6 +2573,15 @@
 
 void Fl_X::destroy() {
   if (w && !w->parent() && xid) {
+    /* Fix for STR #2595: don't delete the xid of a subwindow because it is 
shared
+     with the xid of its parent window.
+     The link from subwindow to parent may have been removed already.
+     This algorithm makes sure that none of the windows of the window list 
uses this xid.
+     Is there a better algorithm ?
+     */
+    for (Fl_X *xo = Fl_X::first; xo; xo = xo->next) {
+      if (xo->xid == xid) return;
+      }
     [[(NSWindow *)xid contentView] release];
     [(NSWindow *)xid close];
   }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to