Mercurial > dwindows
comparison mac/dw.m @ 939:0ba3003272a1
Fixes for notebook crashes when destroying pages in conjunction with dw_window_destroy()ing the page contents on Mac.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Wed, 27 Apr 2011 09:00:53 +0000 |
parents | cfcf66a90e8c |
children | b5ae9cf15f68 |
comparison
equal
deleted
inserted
replaced
938:cfcf66a90e8c | 939:0ba3003272a1 |
---|---|
6604 else | 6604 else |
6605 { | 6605 { |
6606 [notebook addTabViewItem:notepage]; | 6606 [notebook addTabViewItem:notepage]; |
6607 } | 6607 } |
6608 [notebook setPageid:(int)(page+1)]; | 6608 [notebook setPageid:(int)(page+1)]; |
6609 [notepage release]; | |
6610 return (unsigned long)page; | 6609 return (unsigned long)page; |
6611 } | 6610 } |
6612 | 6611 |
6613 /* | 6612 /* |
6614 * Remove a page from a notebook. | 6613 * Remove a page from a notebook. |
6621 DWNotebook *notebook = handle; | 6620 DWNotebook *notebook = handle; |
6622 DWNotebookPage *notepage = _notepage_from_id(notebook, pageid); | 6621 DWNotebookPage *notepage = _notepage_from_id(notebook, pageid); |
6623 | 6622 |
6624 if(notepage != nil) | 6623 if(notepage != nil) |
6625 { | 6624 { |
6626 DWBox *page = [notepage view]; | |
6627 Box *thisbox = [page box]; | |
6628 if(thisbox) | |
6629 { | |
6630 id object = thisbox->items[0].hwnd; | |
6631 [object removeFromSuperview]; | |
6632 [object retain]; | |
6633 free(thisbox->items); | |
6634 thisbox->count = 0; | |
6635 thisbox->items = NULL; | |
6636 } | |
6637 [notebook removeTabViewItem:notepage]; | 6625 [notebook removeTabViewItem:notepage]; |
6638 [notepage release]; | |
6639 } | 6626 } |
6640 } | 6627 } |
6641 | 6628 |
6642 /* | 6629 /* |
6643 * Queries the currently visible page ID. | 6630 * Queries the currently visible page ID. |