MCPcopy Create free account
hub / github.com/DentonW/DevIL / ilCloseImage

Function ilCloseImage

DevIL/src-IL/src/il_stack.cpp:203–260  ·  view source on GitHub ↗

Closes Image and frees all memory associated with it.

Source from the content-addressed store, hash-verified

201
202//! Closes Image and frees all memory associated with it.
203ILAPI void ILAPIENTRY ilCloseImage(ILimage *Image)
204{
205 if (Image == NULL)
206 return;
207
208 if (Image->Data != NULL) {
209 ifree(Image->Data);
210 Image->Data = NULL;
211 }
212
213 if (Image->Pal.Palette != NULL && Image->Pal.PalSize > 0 && Image->Pal.PalType != IL_PAL_NONE) {
214 ifree(Image->Pal.Palette);
215 Image->Pal.Palette = NULL;
216 }
217
218 if (Image->Next != NULL) {
219 ilCloseImage(Image->Next);
220 Image->Next = NULL;
221 }
222
223 if (Image->Faces != NULL) {
224 ilCloseImage(Image->Faces);
225 Image->Mipmaps = NULL;
226 }
227
228 if (Image->Mipmaps != NULL) {
229 ilCloseImage(Image->Mipmaps);
230 Image->Mipmaps = NULL;
231 }
232
233 if (Image->Layers != NULL) {
234 ilCloseImage(Image->Layers);
235 Image->Layers = NULL;
236 }
237
238 if (Image->AnimList != NULL && Image->AnimSize != 0) {
239 ifree(Image->AnimList);
240 Image->AnimList = NULL;
241 }
242
243 if (Image->Profile != NULL && Image->ProfileSize != 0) {
244 ifree(Image->Profile);
245 Image->Profile = NULL;
246 Image->ProfileSize = 0;
247 }
248
249 if (Image->DxtcData != NULL && Image->DxtcFormat != IL_DXT_NO_COMP) {
250 ifree(Image->DxtcData);
251 Image->DxtcData = NULL;
252 Image->DxtcFormat = IL_DXT_NO_COMP;
253 Image->DxtcSize = 0;
254 }
255
256 ifree(Image);
257 Image = NULL;
258
259 return;
260}

Callers 15

ILAPIENTRY iluContrastFunction · 0.85
ILAPIENTRY iluSharpenFunction · 0.85
iluScaleAdvancedFunction · 0.85
ILAPIENTRY iluRotateFunction · 0.85
ILAPIENTRY iluRotate3DFunction · 0.85
ILAPIENTRY iluRotate_Function · 0.85
ILAPIENTRY iluScaleFunction · 0.85
ILAPIENTRY iluScale_Function · 0.85
ILAPIENTRY iluEqualizeFunction · 0.85
iConvertPaletteFunction · 0.85
ILAPIENTRY iConvertImageFunction · 0.85

Calls

no outgoing calls

Tested by 4

mainFunction · 0.68
NewTestFunction · 0.68
DoomTestFunction · 0.68
IcoCurTestFunction · 0.68