From c7da78f1441e92984f9a822371aa01057815c932 Mon Sep 17 00:00:00 2001 From: kreatordxx <> Date: Sun, 25 Jul 2010 02:43:22 +0000 Subject: [PATCH] Fix crash caused by last commit (whoops) --- CHANGELOG.txt | 1 + main/newmenu.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 08cefd2fc..43a70226b 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -5,6 +5,7 @@ D2X-Rebirth Changelog arch/sdl/event.c, arch/ogl/gr.c, arch/sdl/gr.c: Exit SDL_PollEvent early if window changes, to avoid menu problems when pressing keys fast; fix 'condition is always false' warning main/inferno.c, main/inferno.h, main/movie.c: Rewrite quit system, fixing *many* bugs with it :P main/newmenu: For menus, only call the user function for closing immediately before closing, fixing memory errors when the user function frees memory +main/newmenu.c: Fix crash caused by last commit (whoops) 20100721 -------- diff --git a/main/newmenu.c b/main/newmenu.c index 7096533e4..c13923b47 100644 --- a/main/newmenu.c +++ b/main/newmenu.c @@ -1538,7 +1538,8 @@ int newmenu_handler(window *wind, d_event *event, newmenu *menu) if (window_exists(wind)) { - (*menu->subfunction)(menu, event, menu->userdata); // can't cancel here - too hard + if (menu->subfunction) + (*menu->subfunction)(menu, event, menu->userdata); // can't cancel here - too hard d_free(menu); } break;