mirror of
https://github.com/godotengine/godot
synced 2024-09-05 09:48:26 +00:00
Merge pull request #92454 from jsjtxietian/multi-connect
Prevent connect `scroll_to_paragraph` multiple times to `class_desc`
This commit is contained in:
commit
4d255a1b50
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue