Corrected an error in the extract section setup of the tech file

that allocates and deallocates a single layer mask used by the
tech reader.  Decided to work around the issue just by allocating
it only once and not releasing it---it's just a few bytes.
This commit is contained in:
Tim Edwards
2023-02-22 17:56:45 -05:00
parent be577d4318
commit 33d0d53d34
+3 -4
View File
@@ -55,7 +55,7 @@ ExtStyle *ExtCurStyle = NULL;
ExtKeep *ExtAllStyles = NULL;
/* Mask of all types found in the extract section */
TileTypeBitMask *allExtractTypes;
TileTypeBitMask *allExtractTypes = NULL;
/* Forward declarations */
void extTechFinalStyle();
@@ -1025,7 +1025,8 @@ ExtTechInit()
}
ExtAllStyles = NULL;
allExtractTypes = (TileTypeBitMask *)mallocMagic(sizeof(TileTypeBitMask));
if (allExtractTypes == NULL)
allExtractTypes = (TileTypeBitMask *)mallocMagic(sizeof(TileTypeBitMask));
TTMaskZero(allExtractTypes);
}
@@ -3249,8 +3250,6 @@ ExtTechFinal()
TxPrintf("\n");
break;
}
freeMagic(allExtractTypes);
}