From fb27c5897740da1da65d7c5e0bf67dee0bab82aa Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Thu, 7 Sep 2006 16:13:41 +0000 Subject: Don't create a second Menu object unless the first one has been deleted. This seems to fix bug #1553513 ("AGI: Crash after restart"). svn-id: r23833 --- engines/agi/agi.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'engines/agi') diff --git a/engines/agi/agi.cpp b/engines/agi/agi.cpp index aa17ba1fa3..2c083959de 100644 --- a/engines/agi/agi.cpp +++ b/engines/agi/agi.cpp @@ -311,7 +311,9 @@ int agi_init() { init_words(); - menu = new Menu(); + if (!menu) + menu = new Menu(); + init_pri_table(); /* clear string buffer */ @@ -522,6 +524,7 @@ void AgiEngine::initialize() { game.sbuf = (uint8 *) calloc(_WIDTH, _HEIGHT); game.hires = (uint8 *) calloc(_WIDTH * 2, _HEIGHT); + menu = 0; _sprites = new SpritesMan; _text = new TextMan; init_video(); -- cgit v1.2.3