From 194d01b9ae7edd40552c1f0ff1a071daaadc7b71 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Thu, 18 Dec 2014 13:27:33 -0800 Subject: [PATCH] don't try to free console gfx data if not initialized --- main/console.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/console.c b/main/console.c index 0eed57ff..4e0093a0 100644 --- a/main/console.c +++ b/main/console.c @@ -665,14 +665,16 @@ void CON_Free(void) { console->ConsoleLines = NULL; console->CommandLines = NULL; - gr_free_canvas(console->ConsoleSurface); + if (console->ConsoleSurface) + gr_free_canvas(console->ConsoleSurface); console->ConsoleSurface = NULL; if (console->BackgroundImage) gr_free_bitmap(console->BackgroundImage); console->BackgroundImage = NULL; - gr_free_bitmap(console->InputBackground); + if (console->InputBackground) + gr_free_bitmap(console->InputBackground); console->InputBackground = NULL; con_initialized = 0; -- 2.39.2