From b33811d46b46d857c3c6495229db6e01133b16fe Mon Sep 17 00:00:00 2001 From: jsjtxietian Date: Tue, 28 May 2024 10:11:02 +0800 Subject: [PATCH] Prevent connect `scroll_to_paragraph` multiple times to `class_desc` --- editor/editor_help.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp index 988424170814..8ecf31d875d1 100644 --- a/editor/editor_help.cpp +++ b/editor/editor_help.cpp @@ -2340,6 +2340,9 @@ void EditorHelp::_help_callback(const String &p_topic) { if (class_desc->is_ready()) { // call_deferred() is not enough. + if (class_desc->is_connected(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph))) { + class_desc->disconnect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph)); + } class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED); } else { scroll_to = line;