Re-add catches for the case in which a menu callback destroys the menu. - John Fay
git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@181 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
parent
fdd998e66a
commit
59e9cae134
@ -1507,12 +1507,13 @@ LRESULT CALLBACK fgWindowProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lPara
|
|||||||
/* Save the current window and menu and set the current window to the window whose menu this is */
|
/* Save the current window and menu and set the current window to the window whose menu this is */
|
||||||
SFG_Window *save_window = fgStructure.Window ;
|
SFG_Window *save_window = fgStructure.Window ;
|
||||||
SFG_Menu *save_menu = fgStructure.Menu ;
|
SFG_Menu *save_menu = fgStructure.Menu ;
|
||||||
|
SFG_Window *parent_window = window->ActiveMenu->ParentWindow ;
|
||||||
fgSetWindow ( window ) ;
|
fgSetWindow ( window ) ;
|
||||||
fgStructure.Menu = window->ActiveMenu ;
|
fgStructure.Menu = window->ActiveMenu ;
|
||||||
|
|
||||||
/* Execute the menu callback */
|
/* Execute the menu callback */
|
||||||
fgExecuteMenuCallback ( window->ActiveMenu ) ;
|
fgExecuteMenuCallback ( window->ActiveMenu ) ;
|
||||||
fgDeactivateMenu ( window->ActiveMenu->ParentWindow ) ;
|
fgDeactivateMenu ( parent_window ) ;
|
||||||
|
|
||||||
/* Restore the current window and menu */
|
/* Restore the current window and menu */
|
||||||
fgSetWindow ( save_window ) ;
|
fgSetWindow ( save_window ) ;
|
||||||
|
Reference in New Issue
Block a user