From 4c3e4cf122b9665403e3ef828a0fc6a50cc4ab32 Mon Sep 17 00:00:00 2001 From: mcmartin Date: Fri, 1 Feb 2008 08:09:07 +0000 Subject: [PATCH] Properly handle cleanup of the Eta Vulpeculae II stringtable (Bug 1028) git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2915 8092fc87-c524-0410-9efc-e669fe64eaf9 --- sc2/ChangeLog | 1 + sc2/src/sc2code/planets/genorz.c | 11 ----------- sc2/src/sc2code/planets/lander.c | 13 +++++++++---- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/sc2/ChangeLog b/sc2/ChangeLog index 039a0a26b..cb741529f 100644 --- a/sc2/ChangeLog +++ b/sc2/ChangeLog @@ -1,4 +1,5 @@ Changes towards version 0.7: +- Androsynth ruins freeing condition now uses cycles (Bug #1028) - Michael - .rmp files now carry the types of the targets - Michael - Joystick threshold defaults to 10,000, not 0 (Bug #1046) - Michael - Remove MEM_HANDLEs from everywhere outside of memlib - Michael diff --git a/sc2/src/sc2code/planets/genorz.c b/sc2/src/sc2code/planets/genorz.c index 8e2467b7f..f0086573c 100644 --- a/sc2/src/sc2code/planets/genorz.c +++ b/sc2/src/sc2code/planets/genorz.c @@ -62,10 +62,6 @@ GenerateAndrosynth (BYTE control) { pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] &= ~(1L << i); - /* so won't get freed in lander.c */ - CaptureStringTable (GetStringTable ( - pSolarSysState->SysInfo.PlanetInfo.DiscoveryString - )); if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[ENERGY_SCAN] & (1L << (i + 16)))) { @@ -86,13 +82,6 @@ GenerateAndrosynth (BYTE control) pSolarSysState->SysInfo.PlanetInfo.DiscoveryString, 1 ); - if (GetStringTableIndex ( - pSolarSysState->SysInfo.PlanetInfo.DiscoveryString - ) == 0) - /* so will get freed in lander.c */ - ReleaseStringTable ( - pSolarSysState->SysInfo.PlanetInfo.DiscoveryString - ); } } } diff --git a/sc2/src/sc2code/planets/lander.c b/sc2/src/sc2code/planets/lander.c index 6eb5ec0e1..c4a219fb3 100644 --- a/sc2/src/sc2code/planets/lander.c +++ b/sc2/src/sc2code/planets/lander.c @@ -850,10 +850,15 @@ CheckObjectCollision (COUNT index) if (!(pSolarSysState->SysInfo.PlanetInfo.ScanRetrieveMask[scan] & (1L << which_node))) { - if (DestroyStringTable (ReleaseStringTable ( - pSolarSysState->SysInfo.PlanetInfo.DiscoveryString - ))) - pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0; + /* If our discovery strings have cycled, we're done */ + if (GetStringTableIndex ( + pSolarSysState->SysInfo.PlanetInfo.DiscoveryString) == 0) + { + if (DestroyStringTable (ReleaseStringTable ( + pSolarSysState->SysInfo.PlanetInfo.DiscoveryString + ))) + pSolarSysState->SysInfo.PlanetInfo.DiscoveryString = 0; + } } else {