Commit 3f91e752 authored by Clinton Stimpson's avatar Clinton Stimpson Committed by Alexandre Julliard

comctl32: Destroy header information on WM_NCDESTROY instead of WM_DESTROY.

parent b4f0adbf
...@@ -1502,10 +1502,17 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1502,10 +1502,17 @@ HEADER_Create (HWND hwnd, WPARAM wParam, LPARAM lParam)
static LRESULT static LRESULT
HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{ {
HTHEME theme = GetWindowTheme(hwnd);
CloseThemeData(theme);
return 0;
}
static LRESULT
HEADER_NCDestroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
{
HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd); HEADER_INFO *infoPtr = HEADER_GetInfoPtr (hwnd);
HEADER_ITEM *lpItem; HEADER_ITEM *lpItem;
INT nItem; INT nItem;
HTHEME theme;
if (infoPtr->items) { if (infoPtr->items) {
lpItem = infoPtr->items; lpItem = infoPtr->items;
...@@ -1519,13 +1526,11 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam) ...@@ -1519,13 +1526,11 @@ HEADER_Destroy (HWND hwnd, WPARAM wParam, LPARAM lParam)
Free(infoPtr->order); Free(infoPtr->order);
if (infoPtr->himl) if (infoPtr->himl)
ImageList_Destroy (infoPtr->himl); ImageList_Destroy (infoPtr->himl);
SetWindowLongPtrW (hwnd, 0, 0); SetWindowLongPtrW (hwnd, 0, 0);
Free (infoPtr); Free (infoPtr);
theme = GetWindowTheme(hwnd);
CloseThemeData(theme);
return 0; return 0;
} }
...@@ -2078,6 +2083,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) ...@@ -2078,6 +2083,9 @@ HEADER_WindowProc (HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
case WM_DESTROY: case WM_DESTROY:
return HEADER_Destroy (hwnd, wParam, lParam); return HEADER_Destroy (hwnd, wParam, lParam);
case WM_NCDESTROY:
return HEADER_NCDestroy (hwnd, wParam, lParam);
case WM_ERASEBKGND: case WM_ERASEBKGND:
return 1; return 1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment