Cleanup
After your program is finished using IDL (typically just before it exits) it should call IDL_Cleanup() to allow IDL to shut down gracefully. IDL_Cleanup() returns a status value that can be passed to Exit().
where:
just_cleanup
If TRUE, IDL_Cleanup() does all the process shutdown tasks, but doesn't actually exit the process. If FALSE (the usual), the process exits.
Microsoft Windows applications should place this call in their Main WndProc to be called as a result of the WM_CLOSE message.