[UI] Fix use-after-free in NoProfileDialog when closing

This commit is contained in:
Herman S.
2026-03-04 20:50:30 +09:00
parent 4bd93883ac
commit a1710699cd

View File

@@ -45,7 +45,7 @@ void NoProfileDialog::OnDraw(ImGuiIO& io) {
ImGuiWindowFlags_AlwaysAutoResize |
ImGuiWindowFlags_HorizontalScrollbar)) {
ImGui::End();
delete this;
Close();
return;
}
@@ -82,7 +82,7 @@ void NoProfileDialog::OnDraw(ImGuiIO& io) {
if (ImGui::Button("Close") || !dialog_open) {
emulator_window_->SetHotkeysState(true);
ImGui::End();
delete this;
Close();
return;
}
ImGui::End();