瀏覽代碼

DisplayManagerWin: clear previous state when listing display/modes again

So what if the method is called "initialize", it can be run multiple
times anyway. Probably doesn't fix much. Completely untested.
Vincent Lang 9 年之前
父節點
當前提交
bbdfb39b8d
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/display/win/DisplayManagerWin.cpp

+ 3 - 0
src/display/win/DisplayManagerWin.cpp

@@ -17,6 +17,9 @@ bool DisplayManagerWin::initialize()
   DISPLAY_DEVICEW displayInfo;
   int displayId = 0;
 
+  m_displayAdapters.clear();
+  displays.clear();
+
   while (getDisplayInfo(displayId, displayInfo))
   {
     if (displayInfo.StateFlags & (DISPLAY_DEVICE_ACTIVE | DISPLAY_DEVICE_ATTACHED))