MCPcopy Index your code
hub / github.com/MapServer/MapServer / msFreeLabelCacheSlot

Function msFreeLabelCacheSlot

mapfile.c:5161–5193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5159
5160
5161int msFreeLabelCacheSlot(labelCacheSlotObj *cacheslot) {
5162 int i, j;
5163
5164 /* free the labels */
5165 if (cacheslot->labels)
5166 for(i=0; i<cacheslot->numlabels; i++) {
5167 msFree(cacheslot->labels[i].text);
5168 if (cacheslot->labels[i].labelpath)
5169 msFreeLabelPathObj(cacheslot->labels[i].labelpath);
5170 freeLabel(&(cacheslot->labels[i].label));
5171 msFreeShape(cacheslot->labels[i].poly); /* empties the shape */
5172 msFree(cacheslot->labels[i].poly); /* free's the pointer */
5173 for(j=0;j<cacheslot->labels[i].numstyles; j++) freeStyle(&(cacheslot->labels[i].styles[j]));
5174 msFree(cacheslot->labels[i].styles);
5175 }
5176 msFree(cacheslot->labels);
5177 cacheslot->labels = NULL;
5178 cacheslot->cachesize = 0;
5179 cacheslot->numlabels = 0;
5180
5181 /* free the markers */
5182 if (cacheslot->markers)
5183 for(i=0; i<cacheslot->nummarkers; i++) {
5184 msFreeShape(cacheslot->markers[i].poly);
5185 msFree(cacheslot->markers[i].poly);
5186 }
5187 msFree(cacheslot->markers);
5188 cacheslot->markers = NULL;
5189 cacheslot->markercachesize = 0;
5190 cacheslot->nummarkers = 0;
5191
5192 return(MS_SUCCESS);
5193}
5194
5195int msFreeLabelCache(labelCacheObj *cache) {
5196 int p;

Callers 2

msFreeLabelCacheFunction · 0.85
msInitLabelCacheSlotFunction · 0.85

Calls 5

msFreeFunction · 0.85
msFreeLabelPathObjFunction · 0.85
freeLabelFunction · 0.85
msFreeShapeFunction · 0.85
freeStyleFunction · 0.85

Tested by

no test coverage detected