MCPcopy Create free account
hub / github.com/SimHacker/micropolis / destroyMapArrays

Method destroyMapArrays

MicropolisCore/src/MicropolisEngine/src/allocate.cpp:100–157  ·  view source on GitHub ↗

Free all map arrays */

Source from the content-addressed store, hash-verified

98
99/** Free all map arrays */
100void Micropolis::destroyMapArrays()
101{
102
103 if (mapBase != NULL) {
104 freePtr(mapBase);
105 mapBase = NULL;
106 }
107
108 memset(map, 0, sizeof(short *) * WORLD_W);
109
110 populationDensityMap.clear();
111 trafficDensityMap.clear();
112 pollutionDensityMap.clear();
113 landValueMap.clear();
114 crimeRateMap.clear();
115
116 tempMap1.clear();
117 tempMap2.clear();
118 tempMap3.clear();
119
120 terrainDensityMap.clear();
121
122 if (resHist != NULL) {
123 freePtr(resHist);
124 resHist = NULL;
125 }
126
127 if (comHist != NULL) {
128 freePtr(comHist);
129 comHist = NULL;
130 }
131
132 if (indHist != NULL) {
133 freePtr(indHist);
134 indHist = NULL;
135 }
136
137 if (moneyHist != NULL) {
138 freePtr(moneyHist);
139 moneyHist = NULL;
140 }
141
142 if (pollutionHist != NULL) {
143 freePtr(pollutionHist);
144 pollutionHist = NULL;
145 }
146
147 if (crimeHist != NULL) {
148 freePtr(crimeHist);
149 crimeHist = NULL;
150 }
151
152 if (miscHist != NULL) {
153 freePtr(miscHist);
154 miscHist = NULL;
155 }
156
157}

Callers

nothing calls this directly

Calls 1

clearMethod · 0.45

Tested by

no test coverage detected