changeset 1331:4c12170f003f

Make dw_notebook_page_destroy() on OS/2 and Windows destroy the contents of the page. I found that on GTK the contents will have the reference count lowered when the page is removed. Causing the contents to be destroyed... however this does not happen on OS/2 or Windows. The option was to either reference the contents before destroying the page on GTK or have OS/2 and Windows destroy the contents. Because of the name I decided to destroy the contents. It isn't clear to me what the behavior of removeTabViewItem is on the Mac so no changes there.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Thu, 10 Nov 2011 18:06:32 +0000
parents c63069148357
children c0f29ce1a879
files os2/dw.c win/dw.c
diffstat 2 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/os2/dw.c	Thu Nov 10 14:24:37 2011 +0000
+++ b/os2/dw.c	Thu Nov 10 18:06:32 2011 +0000
@@ -6404,8 +6404,12 @@
  */
 void API dw_notebook_page_destroy(HWND handle, unsigned int pageid)
 {
+   HWND pagehwnd = (HWND)WinSendMsg(handle, BKM_QUERYPAGEWINDOWHWND,
+                                    MPFROMLONG(pageid), 0L);
    WinSendMsg(handle, BKM_DELETEPAGE,
             MPFROMLONG(pageid),  (MPARAM)BKA_SINGLE);
+   if(pagehwnd)
+      dw_window_destroy(pagehwnd);
 }
 
 /*
--- a/win/dw.c	Thu Nov 10 14:24:37 2011 +0000
+++ b/win/dw.c	Thu Nov 10 18:06:32 2011 +0000
@@ -6672,6 +6672,7 @@
 {
    NotebookPage **array = (NotebookPage **)dw_window_get_data(handle, "_dw_array");
    int newid = -1, z, pageid;
+   HWND pagehwnd = 0;
 
    if(!array)
       return;
@@ -6684,6 +6685,7 @@
    if(array[pageid])
    {
       SetParent(array[pageid]->hwnd, DW_HWND_OBJECT);
+      pagehwnd = array[pageid]->hwnd;
       free(array[pageid]);
       array[pageid] = NULL;
    }
@@ -6709,6 +6711,8 @@
       _resize_notebook_page(handle, newid);
       dw_notebook_page_set(handle, array[newid]->realid);
    }
+   if(pagehwnd)
+      dw_window_destroy(pagehwnd);
 }
 
 /*