Changeset 1829 for trunk/dll/common.c


Ignore:
Timestamp:
Jul 13, 2015, 12:01:22 AM (10 years ago)
Author:
Gregg Young
Message:

Fix CN_REALLOCPSZ file name editing code to: 1) Actually reallocate the buffer. 2) Point pci->pszDisplayName into the new buffer 3) Eliminate the possibility of updating the container before CN_ENDEDIT is called. 4) Only call RemoveCnrItems for tree container and collector. Ticket [557]

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dll/common.c

    r1777 r1829  
    3333  14 Sep 09 SHL Blink thread LEDs while threads working
    3434  17 JAN 10 GKY Changes to get working with Watcom 1.9 Beta (1/16/10). Mostly cast CHAR CONSTANT * as CHAR *.
     35  12 Jul 15 GKY Fix CN_REALLOCPSZ file name editing code to: 1) Actually reallocate the buffer.
     36                2) Point pci->pszDisplayName into the new buffer 3) Eliminate the possibility
     37                of updating the container before CN_ENDEDIT is called. 4) Only call RemoveCnrItems
     38                for tree container and collector.
    3539
    3640***********************************************************************/
     
    871875      }
    872876      else if (mp2) {
    873         if ((INT) mp1 == -1) {
    874           PCNRITEM pci = (PCNRITEM) mp2;
    875           RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE);
    876         }
    877         else {
     877        if ((INT) mp1 == -1) {
     878          PCNRITEM pci = (PCNRITEM) mp2;
     879          RemoveCnrItems(hwnd, pci, 1, CMA_FREE | CMA_INVALIDATE);
     880        }
     881        else {
    878882          Broadcast(WinQueryAnchorBlock(hwnd),
    879                     dcd->hwndParent, UM_UPDATERECORD, mp2, MPVOID);
    880           free(mp2);
    881         }
     883                    dcd->hwndParent, UM_UPDATERECORD, mp2, MPVOID);
     884          xfree(mp2, pszSrcFile, __LINE__);
     885        }
    882886      }
    883887    }
Note: See TracChangeset for help on using the changeset viewer.