From eb7faf1a3717a2394d2f61291f439d6405ed9ccc Mon Sep 17 00:00:00 2001 From: Augtons <79037928+Augtons@users.noreply.github.com> Date: Sat, 30 Mar 2024 21:39:31 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=AA=97=E5=8F=A3=E6=9C=80=E5=B0=8F=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E5=85=B3=E9=97=AD=E5=AF=BC=E8=87=B4=E7=9A=84=E5=B4=A9?= =?UTF-8?q?=E6=BA=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lvglsim.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/lvglsim.cpp b/src/lvglsim.cpp index aa42dac..ea6db87 100644 --- a/src/lvglsim.cpp +++ b/src/lvglsim.cpp @@ -142,6 +142,13 @@ void displays_loop() if (windowId == main_window_id) { break; } + auto it = windows.find(windowId); + if (it == windows.end()) { + continue; + } + auto& [_, window_ptr] = *it; + std::lock_guard locker { lock }; + SDL_RestoreWindow(window_ptr->getSDLWindowPointer()); // 因为部分平台,关闭最小化窗口可能导致崩溃 windows.erase(windowId); controller.erase(windowId); continue;