Fix crash that occurs when closing application window while invetory is displayed.
This commit is contained in:
committed by
Pasi Kallinen
parent
497a0b47c8
commit
be4e0992e6
@@ -884,6 +884,11 @@ GetMenuControl(HWND hWnd)
|
|||||||
|
|
||||||
data = (PNHMenuWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
data = (PNHMenuWindow) GetWindowLongPtr(hWnd, GWLP_USERDATA);
|
||||||
|
|
||||||
|
/* We may continue getting window messages after a window's WM_DESTROY is
|
||||||
|
called. We need to handle the case that USERDATA has been freed. */
|
||||||
|
if (data == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (data->type == MENU_TYPE_TEXT) {
|
if (data->type == MENU_TYPE_TEXT) {
|
||||||
return GetDlgItem(hWnd, IDC_MENU_TEXT);
|
return GetDlgItem(hWnd, IDC_MENU_TEXT);
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user