[Scummvm-cvs-logs] SF.net SVN: scummvm:[52079] scummvm/trunk/engines/sci/graphics/ports.cpp
m_kiewitz at users.sourceforge.net
m_kiewitz at users.sourceforge.net
Sat Aug 14 10:03:33 CEST 2010
Revision: 52079
http://scummvm.svn.sourceforge.net/scummvm/?rev=52079&view=rev
Author: m_kiewitz
Date: 2010-08-14 08:03:32 +0000 (Sat, 14 Aug 2010)
Log Message:
-----------
SCI: now reusing window ids on kNewWindow
sq4cd recreates the inventory window several times, but also reuses old window ids, causing kernelSetActive errors. fixes bug #3044757
Modified Paths:
--------------
scummvm/trunk/engines/sci/graphics/ports.cpp
Modified: scummvm/trunk/engines/sci/graphics/ports.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/ports.cpp 2010-08-14 06:06:41 UTC (rev 52078)
+++ scummvm/trunk/engines/sci/graphics/ports.cpp 2010-08-14 08:03:32 UTC (rev 52079)
@@ -288,6 +288,16 @@
// Find an unused window/port id
uint id = PORTS_FIRSTWINDOWID;
while (id < _windowsById.size() && _windowsById[id]) {
+ if (_windowsById[id]->counterTillFree) {
+ // port that is already disposed, but not freed yet
+ freeWindow((Window *)_windowsById[id]);
+ _freeCounter--;
+ break; // reuse the handle
+ // we do this especially for sq4cd. it creates and disposes the
+ // inventory window all the time, but reuses old handles as well
+ // this worked somewhat under the original interpreter, because
+ // it put the new window where the old was.
+ }
++id;
}
if (id == _windowsById.size())
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