From ac19f2ca68e89f53c33c8553775bf1c402d88206 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A3=8E=E9=9D=92=E5=B1=B1?= Date: Sat, 8 Mar 2025 13:16:41 +0800 Subject: [PATCH] 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. --- scene/main/viewport.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/main/viewport.cpp b/scene/main/viewport.cpp index bf04dc0f4d4..6c56eca1a1c 100644 --- a/scene/main/viewport.cpp +++ b/scene/main/viewport.cpp @@ -1505,6 +1505,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; }