[Scummvm-cvs-logs] SF.net SVN: scummvm: [27993] scummvm/trunk/engines/agi/agi.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Mon Jul 9 19:39:47 CEST 2007


Revision: 27993
          http://scummvm.svn.sourceforge.net/scummvm/?rev=27993&view=rev
Author:   thebluegr
Date:     2007-07-09 10:39:47 -0700 (Mon, 09 Jul 2007)

Log Message:
-----------
Fix for bug #1742432 - AGI: Engine crashes if no game is detected

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.cpp

Modified: scummvm/trunk/engines/agi/agi.cpp
===================================================================
--- scummvm/trunk/engines/agi/agi.cpp	2007-07-09 17:30:50 UTC (rev 27992)
+++ scummvm/trunk/engines/agi/agi.cpp	2007-07-09 17:39:47 UTC (rev 27993)
@@ -676,6 +676,13 @@
 }
 
 AgiEngine::~AgiEngine() {
+	// If the engine hasn't been initialized yet via AgiEngine::initialize(), don't attempt to free any resources,
+	// as they haven't been allocated. Fixes bug #1742432 - AGI: Engine crashes if no game is detected
+	if (_game.state == STATE_INIT) {
+		delete _rnd;	// delete _rnd, as it is allocated in the constructor, not in initialize()
+		return;
+	}
+
 	agiDeinit();
 	_sound->deinitSound();
 	delete _sound;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list