Frees any extra memory in the stack. - Called on exit
| 636 | // Frees any extra memory in the stack. |
| 637 | // - Called on exit |
| 638 | void 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! |
nothing calls this directly
no test coverage detected