# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1341130604 0 # Node ID 31edce4598d0de97871ed9b0fa3af6556abaaef9 # Parent 47e503ecc8124aabb64d36f72973461ea98eb624 On OS/2 make a duplicate of the column titles when setting up containers... In DWIB now that it no longer leaks XML memory, the memory for the column titles in the XML tree gets freed and the OS/2 columns then show corrupted memory. So duplicate the titles and free them when destroyed. diff -r 47e503ecc812 -r 31edce4598d0 os2/dw.c --- a/os2/dw.c Sun Jul 01 07:51:25 2012 +0000 +++ b/os2/dw.c Sun Jul 01 08:16:44 2012 +0000 @@ -508,6 +508,7 @@ else if(strncmp(tmpbuf, "#37", 4)==0) { char *coltitle = (char *)dw_window_get_data(handle, "_dw_coltitle"); + PFIELDINFO first; dw_container_clear(handle, FALSE); if(wd && dw_window_get_data(handle, "_dw_container")) @@ -516,6 +517,13 @@ wd->data = NULL; free(oldflags); } + /* Free memory allocated for the container column titles */ + while((first = (PFIELDINFO)WinSendMsg(handle, CM_QUERYDETAILFIELDINFO, 0, MPFROMSHORT(CMA_FIRST))) != NULL) + { + if(first->pTitleData) + free(first->pTitleData); + WinSendMsg(handle, CM_REMOVEDETAILFIELDINFO, (MPARAM)&first, MPFROM2SHORT(1, CMA_FREE)); + } if(coltitle) free(coltitle); } @@ -9231,7 +9239,7 @@ details->cb = sizeof(FIELDINFO); details->flData = flags[z]; details->flTitle = CFA_FITITLEREADONLY; - details->pTitleData = titles[z]; + details->pTitleData = strdup(titles[z]); details->offStruct = offStruct[z]; details = details->pNextFieldInfo; }