You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #49650 from KoBeWi/FindReplaceCrash
Fix crash with FindReplaceBar
This commit is contained in:
@@ -105,6 +105,11 @@ void FindReplaceBar::_notification(int p_what) {
|
||||
hide_button->set_custom_minimum_size(hide_button->get_normal_texture()->get_size());
|
||||
} else if (p_what == NOTIFICATION_THEME_CHANGED) {
|
||||
matches_label->add_theme_color_override("font_color", results_count > 0 ? get_theme_color("font_color", "Label") : get_theme_color("error_color", "Editor"));
|
||||
} else if (p_what == NOTIFICATION_PREDELETE) {
|
||||
if (base_text_editor) {
|
||||
base_text_editor->remove_find_replace_bar();
|
||||
base_text_editor = nullptr;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -595,6 +600,10 @@ void FindReplaceBar::set_text_edit(CodeTextEditor *p_text_editor) {
|
||||
text_editor = nullptr;
|
||||
}
|
||||
|
||||
if (!p_text_editor) {
|
||||
return;
|
||||
}
|
||||
|
||||
results_count = -1;
|
||||
base_text_editor = p_text_editor;
|
||||
text_editor = base_text_editor->get_text_editor();
|
||||
@@ -1667,6 +1676,11 @@ void CodeTextEditor::_notification(int p_what) {
|
||||
}
|
||||
set_process_input(is_visible_in_tree());
|
||||
} break;
|
||||
case NOTIFICATION_PREDELETE: {
|
||||
if (find_replace_bar) {
|
||||
find_replace_bar->set_text_edit(nullptr);
|
||||
}
|
||||
} break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user