UiClosePopupMenus
in a popup handler, the number of popups was first set to 0
and then decremented to -1
due to the popup itself being closed, which causes the next popup to not open correctly and may also cause a crash due to an out-of-bounds access.
The UiClosePopupMenus
function is adjusted so the number of open popups never goes below 0
.
Another check is added to ensure that UI()->SetActiveItem(nullptr)
is only called when a popup is open, so the currently act...