Skip to content

Commit

Permalink
fix: 修复部分平台窗口最小化时关闭导致的崩溃问题
Browse files Browse the repository at this point in the history
  • Loading branch information
Augtons committed Mar 30, 2024
1 parent 0ddffd5 commit eb7faf1
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/lvglsim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit eb7faf1

Please sign in to comment.