summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2011-03-25 23:17:16 +0000
committerManolo Gouy <Manolo>2011-03-25 23:17:16 +0000
commit3b7ff83e0475da627233321f1f926f40bccbec87 (patch)
tree3fe008ee680ed0f642299174822b3482ae20bb97 /src
parentf088e583a173cfd6cd80df7719a1a7ce9324ca2e (diff)
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 ? git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8534 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src')
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index fc7cb7a22..bab8ce6bd 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -2573,6 +2573,15 @@ void Fl_X::relink(Fl_Window *w, Fl_Window *wp) {
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];
}