comctl32 header: Free the old string also when the new one is LPSTR_TEXTCALLBACK.
This commit is contained in:
parent
16fefcd6d9
commit
25d66de358
@ -131,17 +131,16 @@ static void HEADER_StoreHDItemInHeader(HEADER_ITEM *lpItem, HDITEMW *phdi, BOOL
|
|||||||
|
|
||||||
if (phdi->mask & HDI_TEXT)
|
if (phdi->mask & HDI_TEXT)
|
||||||
{
|
{
|
||||||
|
if (lpItem->pszText)
|
||||||
|
{
|
||||||
|
if (lpItem->pszText != emptyString && lpItem->pszText != LPSTR_TEXTCALLBACKW)
|
||||||
|
Free(lpItem->pszText);
|
||||||
|
lpItem->pszText = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
|
if (phdi->pszText != LPSTR_TEXTCALLBACKW) /* covers != TEXTCALLBACKA too */
|
||||||
{
|
{
|
||||||
LPWSTR pszText;
|
LPWSTR pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString);
|
||||||
if (lpItem->pszText)
|
|
||||||
{
|
|
||||||
if (lpItem->pszText != emptyString && lpItem->pszText != LPSTR_TEXTCALLBACKW)
|
|
||||||
Free(lpItem->pszText);
|
|
||||||
lpItem->pszText = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
pszText = (phdi->pszText != NULL ? phdi->pszText : emptyString);
|
|
||||||
if (fUnicode)
|
if (fUnicode)
|
||||||
Str_SetPtrW(&lpItem->pszText, pszText);
|
Str_SetPtrW(&lpItem->pszText, pszText);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user