程序关闭期间 CoreMessaging.dll 中未处理的异常

Unhandled exception in CoreMessaging.dll during program shutdown

我有一个简单的程序,只显示 window,等待按键,然后退出。在关机期间,应用程序崩溃,抱怨 CoreMessaging.dll。这是有问题的示例代码:

sf::RenderWindow window;

void waitForKeyPress() {
  Event event;
  bool done = false;
  while (!done) {
    while (window.pollEvent(event)) {
      if (event.type == Event::KeyPressed) {
        done = true;
      }
    }
  }
}

int main() {
  // If I don't create the window, there's no crash.
  window.create(VideoMode::getDesktopMode(), "test", Style::Default); 
  waitForKeyPress();
  return 0; // Crashes upon returning.
}

这是我遇到的崩溃:

Unhandled exception at 0x64260032 (CoreMessaging.dll) in game.exe: 0xC0000602: A fail fast exception occurred. Exception handlers will not be invoked and the process will be terminated immediately.

调用堆栈似乎不是特别有用

>   CoreMessaging.dll!64260032()    Unknown
    [Frames below may be incorrect and/or missing, no symbols loaded for CoreMessaging.dll] 
    [External Code] 
    InputHost.dll!5bb78a40()    Unknown
    [External Code] 

该项目是使用 Visual Studio Community 2015 构建的。什么是 CoreMessaging.dll,为什么这个只显示 window 并关闭的简单应用程序有问题?

您的问题是使用有缺陷的过时版本 Windows 10 进行测试,该版本受到现在已通过更新 KB4025342(Win10 版本 15063.483)修复的错误的影响

与您的问题相匹配的错误修复摘要: “解决了 CoreMessaging.dll 可能导致 32 位应用程序在 Windows OS. 的 64 位版本上崩溃的问题”

在此处阅读有关此问题的更多信息:MSDN bugreport link

请更新您的 Windows 构建并检查崩溃是否会消失,然后 select 如果解决了我的回复作为答案。