1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 11:03:00 +01:00

Fix #18481: prevent misuse of moved-from object in WindowTooltipShow (#18483)

This commit is contained in:
Michał Janiszewski
2022-11-02 00:19:43 +01:00
committed by GitHub
parent b2ae5b1413
commit afd0346d66

View File

@@ -139,9 +139,10 @@ void WindowTooltipShow(const OpenRCT2String& message, ScreenCoordsXY screenCoord
return;
auto tooltipWindow = std::make_unique<TooltipWindow>(message, screenCoords);
WindowCreate(
std::move(tooltipWindow), WindowClass::Tooltip, tooltipWindow->windowPos, tooltipWindow->width, tooltipWindow->height,
WF_TRANSPARENT | WF_STICK_TO_FRONT);
auto windowPos = tooltipWindow->windowPos;
auto width = tooltipWindow->width;
auto height = tooltipWindow->height;
WindowCreate(std::move(tooltipWindow), WindowClass::Tooltip, windowPos, width, height, WF_TRANSPARENT | WF_STICK_TO_FRONT);
}
void WindowTooltipOpen(rct_window* widgetWindow, WidgetIndex widgetIndex, const ScreenCoordsXY& screenCoords)