MCPcopy Create free account
hub / github.com/DentonW/DevIL / ILAPIENTRY ilShutDown

Function ILAPIENTRY ilShutDown

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

Frees any extra memory in the stack. - Called on exit

Source from the content-addressed store, hash-verified

636// Frees any extra memory in the stack.
637// - Called on exit
638void ILAPIENTRY ilShutDown()
639{
640 // if it is not initialized do not shutdown
641 iFree* TempFree = (iFree*)FreeNames;
642 ILuint i;
643
644 if (!IsInit)
645 return;
646
647 if (!IsInit) { // Prevent from being called when not initialized.
648 ilSetError(IL_ILLEGAL_OPERATION);
649 return;
650 }
651
652 while (TempFree != NULL) {
653 FreeNames = (iFree*)TempFree->Next;
654 ifree(TempFree);
655 TempFree = FreeNames;
656 }
657
658 //for (i = 0; i < LastUsed; i++) {
659 for (i = 0; i < StackSize; i++) {
660 if (ImageStack[i] != NULL)
661 ilCloseImage(ImageStack[i]);
662 }
663
664 if (ImageStack)
665 ifree(ImageStack);
666 ImageStack = NULL;
667 LastUsed = 0;
668 StackSize = 0;
669 IsInit = IL_FALSE;
670 return;
671}
672
673
674// Initializes the image stack's first entry (default image) -- ONLY CALL ONCE!

Callers

nothing calls this directly

Calls 2

ilSetErrorFunction · 0.85
ilCloseImageFunction · 0.85

Tested by

no test coverage detected