# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1320948392 0 # Node ID 4c12170f003fd2398e945119441be645e66781f1 # Parent c63069148357b4f3af24ad07ddc23eb93be13d11 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. diff -r c63069148357 -r 4c12170f003f os2/dw.c --- 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); } /* diff -r c63069148357 -r 4c12170f003f win/dw.c --- 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); } /*