From fb69c25d487a7a56d115dbcfc011f8e99e241461 Mon Sep 17 00:00:00 2001 From: drian Date: Thu, 15 Apr 2021 10:59:11 +0200 Subject: [PATCH] #208 fixed memory leak in console history --- source/src/console.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/src/console.cpp b/source/src/console.cpp index 4915fdf6..7f1b9bca 100644 --- a/source/src/console.cpp +++ b/source/src/console.cpp @@ -566,7 +566,11 @@ void consolekey(int code, bool isdown, SDL_Keymod mod) if(h) { h->run(); - if(h->action && !storeinputcommand) history.drop(); + if(h->action && !storeinputcommand) + { + delete h; + history.drop(); + } } } else if((code==SDLK_ESCAPE && !ignoreescup) || code== SDL_AC_BUTTON_RIGHT)