Explorar o código

Fixed crash at shutdown on Windows

The taskbar list is invalid after OleUninitialize(), so make sure we clean it up first.

Also don't bother creating the taskbar list if we don't have any progress state
Sam Lantinga hai 2 semanas
pai
achega
c3ce216c4d

+ 6 - 6
src/video/windows/SDL_windowsvideo.c

@@ -583,12 +583,6 @@ void WIN_VideoQuit(SDL_VideoDevice *_this)
     WIN_QuitKeyboard(_this);
     WIN_QuitMouse(_this);
 
-    if (data->oleinitialized) {
-        OleUninitialize();
-        data->oleinitialized = false;
-    }
-#endif // !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
-
 #if defined(HAVE_SHOBJIDL_CORE_H)
     if (data->taskbar_list) {
         IUnknown_Release(data->taskbar_list);
@@ -596,6 +590,12 @@ void WIN_VideoQuit(SDL_VideoDevice *_this)
     }
 #endif
 
+    if (data->oleinitialized) {
+        OleUninitialize();
+        data->oleinitialized = false;
+    }
+#endif // !(defined(SDL_PLATFORM_XBOXONE) || defined(SDL_PLATFORM_XBOXSERIES))
+
     if (data->coinitialized) {
         WIN_CoUninitialize();
         data->coinitialized = false;

+ 4 - 0
src/video/windows/SDL_windowswindow.c

@@ -2253,6 +2253,10 @@ bool WIN_ApplyWindowProgress(SDL_VideoDevice *_this, SDL_Window* window)
         return true;
     }
 
+    if (window->progress_state == SDL_PROGRESS_STATE_NONE && !data->videodata->taskbar_list) {
+        return true;
+    }
+
     ITaskbarList3 *taskbar_list = GetTaskbarList(window);
     if (!taskbar_list) {
         return false;