comctl32: Fix imagelist leak when switching LVS_EX_CHECKBOXES style.
This commit is contained in:
parent
cd7cfd7451
commit
a061d3a0d4
|
@ -7932,8 +7932,16 @@ static DWORD LISTVIEW_SetExtendedListViewStyle(LISTVIEW_INFO *infoPtr, DWORD dwM
|
||||||
LISTVIEW_SetItemState(infoPtr, -1, &item);
|
LISTVIEW_SetItemState(infoPtr, -1, &item);
|
||||||
|
|
||||||
himl = LISTVIEW_CreateCheckBoxIL(infoPtr);
|
himl = LISTVIEW_CreateCheckBoxIL(infoPtr);
|
||||||
|
if(!(infoPtr->dwStyle & LVS_SHAREIMAGELISTS))
|
||||||
|
ImageList_Destroy(infoPtr->himlState);
|
||||||
}
|
}
|
||||||
LISTVIEW_SetImageList(infoPtr, LVSIL_STATE, himl);
|
himl = LISTVIEW_SetImageList(infoPtr, LVSIL_STATE, himl);
|
||||||
|
/* checkbox list replaces prevous custom list or... */
|
||||||
|
if(((infoPtr->dwLvExStyle & LVS_EX_CHECKBOXES) &&
|
||||||
|
!(infoPtr->dwStyle & LVS_SHAREIMAGELISTS)) ||
|
||||||
|
/* ...previous was checkbox list */
|
||||||
|
(dwOldExStyle & LVS_EX_CHECKBOXES))
|
||||||
|
ImageList_Destroy(himl);
|
||||||
}
|
}
|
||||||
|
|
||||||
if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERDRAGDROP)
|
if((infoPtr->dwLvExStyle ^ dwOldExStyle) & LVS_EX_HEADERDRAGDROP)
|
||||||
|
@ -9664,12 +9672,9 @@ static LRESULT LISTVIEW_NCDestroy(LISTVIEW_INFO *infoPtr)
|
||||||
/* destroy image lists */
|
/* destroy image lists */
|
||||||
if (!(infoPtr->dwStyle & LVS_SHAREIMAGELISTS))
|
if (!(infoPtr->dwStyle & LVS_SHAREIMAGELISTS))
|
||||||
{
|
{
|
||||||
if (infoPtr->himlNormal)
|
ImageList_Destroy(infoPtr->himlNormal);
|
||||||
ImageList_Destroy(infoPtr->himlNormal);
|
ImageList_Destroy(infoPtr->himlSmall);
|
||||||
if (infoPtr->himlSmall)
|
ImageList_Destroy(infoPtr->himlState);
|
||||||
ImageList_Destroy(infoPtr->himlSmall);
|
|
||||||
if (infoPtr->himlState)
|
|
||||||
ImageList_Destroy(infoPtr->himlState);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* destroy font, bkgnd brush */
|
/* destroy font, bkgnd brush */
|
||||||
|
|
Loading…
Reference in New Issue