Skip to content

Commit b33811d

Browse files
committed
Prevent connect scroll_to_paragraph multiple times to class_desc
1 parent be56cab commit b33811d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

editor/editor_help.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,6 +2340,9 @@ void EditorHelp::_help_callback(const String &p_topic) {
23402340

23412341
if (class_desc->is_ready()) {
23422342
// call_deferred() is not enough.
2343+
if (class_desc->is_connected(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph))) {
2344+
class_desc->disconnect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph));
2345+
}
23432346
class_desc->connect(SceneStringName(draw), callable_mp(class_desc, &RichTextLabel::scroll_to_paragraph).bind(line), CONNECT_ONE_SHOT | CONNECT_DEFERRED);
23442347
} else {
23452348
scroll_to = line;

0 commit comments

Comments
 (0)