[Scummvm-git-logs] scummvm master -> 4429ba16b48c191d1c94e9045fa5ac445775c054
lephilousophe
noreply at scummvm.org
Sun Aug 23 17:16:05 UTC 2026
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
4429ba16b4 Revert "GUI: Prevent use-after-free in `_tooltip`"
Commit: 4429ba16b48c191d1c94e9045fa5ac445775c054
https://github.com/scummvm/scummvm/commit/4429ba16b48c191d1c94e9045fa5ac445775c054
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2026-08-23T19:15:49+02:00
Commit Message:
Revert "GUI: Prevent use-after-free in `_tooltip`"
This reverts commit 80aca9635f1baedb97f7e058cfc47a4c545d8d89.
This introduces a memory leak because the _tooltip variable is cleared
when closeTopDialog is called.
We could circumvent this by keeping the local variable as before but
still clearing _tooltip in the end.
I prefer that we properly understand the underlying bug instead.
closeTopDialog is expected to be called before returning from runModal
and deleting the tooltip.
Changed paths:
gui/gui-manager.cpp
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp
index d50f93dd60c..d7f4dd03205 100644
--- a/gui/gui-manager.cpp
+++ b/gui/gui-manager.cpp
@@ -701,12 +701,12 @@ void GuiManager::runLoop() {
wdg->handleTooltipUpdate(_lastMousePosition.x + activeDialog->_x - wdg->getAbsX(), _lastMousePosition.y + activeDialog->_y - wdg->getAbsY());
if (wdg->hasTooltip()) {
- _tooltip = new Tooltip();
- _tooltip->setup(activeDialog, wdg, _lastMousePosition.x, _lastMousePosition.y);
+ Tooltip *tooltip = new Tooltip();
+ tooltip->setup(activeDialog, wdg, _lastMousePosition.x, _lastMousePosition.y);
+ _tooltip = tooltip;
_tooltip->runModal();
// _tooltip is reset in closeTopDialog
- delete _tooltip;
- _tooltip = nullptr;
+ delete tooltip;
}
}
}
More information about the Scummvm-git-logs
mailing list