mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-05 19:08:12 +00:00
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
This commit is contained in:
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user