summaryrefslogtreecommitdiffstats
path: root/editor
diff options
context:
space:
mode:
authorjsjtxietian <jsjtxietian@outlook.com>2024-05-28 10:11:02 +0800
committerjsjtxietian <jsjtxietian@outlook.com>2024-05-29 12:58:08 +0800
commitb33811d46b46d857c3c6495229db6e01133b16fe (patch)
treef0aaa9490d4b31a61c80b0b5968ab87ec827af51 /editor
parentbe56cab58c056c074d1e02cd0b38641204e39f41 (diff)
downloadredot-engine-b33811d46b46d857c3c6495229db6e01133b16fe.tar.gz
Prevent connect `scroll_to_paragraph` multiple times to `class_desc`
Diffstat (limited to 'editor')
-rw-r--r--editor/editor_help.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/editor/editor_help.cpp b/editor/editor_help.cpp
index 9884241708..8ecf31d875 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;