Initialize.cpp 745 B

1234567891011121314151617181920212223242526272829303132
  1. #include "il2cpp-config.h"
  2. #if IL2CPP_TARGET_WINRT || IL2CPP_TARGET_XBOXONE
  3. #include "os/Initialize.h"
  4. #include "os/Win32/WindowsHelpers.h"
  5. #if IL2CPP_TARGET_WINRT
  6. #include "os/BrokeredFileSystem.h"
  7. #include "os/Locale.h"
  8. #endif
  9. #include <io.h>
  10. void il2cpp::os::Uninitialize()
  11. {
  12. #if IL2CPP_TARGET_WINRT
  13. BrokeredFileSystem::CleanupStatics();
  14. Locale::UnInitializeWinRT();
  15. #endif
  16. HANDLE stdoutHandle = reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(stdout)));
  17. HANDLE stderrHandle = reinterpret_cast<HANDLE>(_get_osfhandle(_fileno(stderr)));
  18. if (stdoutHandle != INVALID_HANDLE_VALUE)
  19. FlushFileBuffers(stdoutHandle);
  20. if (stderrHandle != INVALID_HANDLE_VALUE)
  21. FlushFileBuffers(stderrHandle);
  22. }
  23. #endif