Fix memory leak caused by hidden tooltip controls

Using hidden controls can override the default tooltip behavior, but these
controls are forgotten to be deleted.

(cherry picked from commit ac19f2ca68)
This commit is contained in:
风青山
2025-03-08 13:16:41 +08:00
committed by Rémi Verschelde
parent f388b5f3af
commit 13c5cc45d0

View File

@ -1509,6 +1509,7 @@ void Viewport::_gui_show_tooltip() {
// This way, the custom tooltip from `ConnectionsDockTree` can create
// its own tooltip without conflicting with the default one, even an empty tooltip.
if (base_tooltip && !base_tooltip->is_visible()) {
memdelete(base_tooltip);
return;
}