Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/imgui_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,7 @@ void ImGuiUIDrawFrame(GameWindow* window) {
if(activeWindows[i]->isModal ? ImGui::BeginPopupModal(activeWindows[i]->title.data(), &activeWindows[i]->open) : ImGui::Begin(activeWindows[i]->title.data(), &activeWindows[i]->open)) {

for(auto&& control : activeWindows[i]->controls) {
activeWindowsLock.unlock();
switch (control.type)
{
case 0:
Expand Down Expand Up @@ -911,6 +912,7 @@ void ImGuiUIDrawFrame(GameWindow* window) {
default:
break;
}
activeWindowsLock.try_lock();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if

  • this returns false?
  • between line 852 and 915 activeWindows and activeWindows[i]->controls has been altered?

I'm more towards agreeing to wrap the content of mcpelauncher_show_window / mcpelauncher_close_window in std::thread([]() -> { <old-body> }).detach(); e.g. queue the mutex lock into it's own thread so the caller don't need to care about the consequences

}
if(activeWindows[i]->isModal) {
ImGui::EndPopup();
Expand Down
Loading