From 38db0980c55d33507a2b6ef4233ac4e8adf3d745 Mon Sep 17 00:00:00 2001 From: Guy Albertelli Date: Thu, 11 May 2000 00:06:38 +0000 Subject: [PATCH] Clear menu handle after destroying menu. --- windows/win.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/windows/win.c b/windows/win.c index a2fa889e511..fb656bc3d5c 100644 --- a/windows/win.c +++ b/windows/win.c @@ -507,8 +507,16 @@ static WND* WIN_DestroyWindow( WND* wndPtr ) } if (!(wndPtr->dwStyle & WS_CHILD)) - if (wndPtr->wIDmenu) DestroyMenu( (HMENU)wndPtr->wIDmenu ); - if (wndPtr->hSysMenu) DestroyMenu( wndPtr->hSysMenu ); + if (wndPtr->wIDmenu) + { + DestroyMenu( wndPtr->wIDmenu ); + wndPtr->wIDmenu = 0; + } + if (wndPtr->hSysMenu) + { + DestroyMenu( wndPtr->hSysMenu ); + wndPtr->hSysMenu = 0; + } wndPtr->pDriver->pDestroyWindow( wndPtr ); DCE_FreeWindowDCE( wndPtr ); /* Always do this to catch orphaned DCs */ WINPROC_FreeProc( wndPtr->winproc, WIN_PROC_WINDOW );