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

Function msFreeImage

maputil.c:848–887  ·  view source on GitHub ↗

* Generic function to free the imageObj */

Source from the content-addressed store, hash-verified

846 * Generic function to free the imageObj
847 */
848void msFreeImage(imageObj *image)
849{
850 if (image)
851 {
852 if(MS_RENDERER_PLUGIN(image->format)) {
853 rendererVTableObj *renderer = image->format->vtable;
854 tileCacheObj *next,*cur = image->tilecache;
855 while(cur) {
856 msFreeImage(cur->image);
857 next = cur->next;
858 free(cur);
859 cur = next;
860 }
861 image->ntiles = 0;
862 renderer->freeImage(image);
863 } else if( MS_RENDERER_IMAGEMAP(image->format) )
864 msFreeImageIM(image);
865 else if( MS_RENDERER_RAWDATA(image->format) )
866 msFree(image->img.raw_16bit);
867 else
868 msSetError(MS_MISCERR, "Unknown image type",
869 "msFreeImage()");
870
871 if (image->imagepath)
872 free(image->imagepath);
873 if (image->imageurl)
874 free(image->imageurl);
875
876 if( --image->format->refcount < 1 )
877 msFreeOutputFormat( image->format );
878
879 image->imagepath = NULL;
880 image->imageurl = NULL;
881
882 msFree( image->img_mask );
883 image->img_mask= NULL;
884
885 msFree( image );
886 }
887}
888
889/*
890** Return an array containing all the layer's index given a group name.

Callers 15

msEmbedScalebarFunction · 0.85
msPrepareImageFunction · 0.85
msDrawMapFunction · 0.85
msDrawLayerFunction · 0.85
addTileCacheFunction · 0.85
getTileFunction · 0.85
msDrawLegendIconFunction · 0.85
msEmbedLegendFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
msWCSGetCoverageFunction · 0.85
msWCSGetCoverage20Function · 0.85

Calls 4

msFreeImageIMFunction · 0.85
msFreeFunction · 0.85
msSetErrorFunction · 0.85
msFreeOutputFormatFunction · 0.85

Tested by

no test coverage detected