Merge pull request #23537 from fire/visualscript-virtual-_function-crash-23536
Fix creating a visual script virtual function after minimizing crashes #23536 and misc vs warning
This commit is contained in:
commit
1e6537bcc8
|
@ -3653,7 +3653,7 @@ VisualScriptEditor::VisualScriptEditor() {
|
|||
new_virtual_method_select = memnew(VisualScriptPropertySelector);
|
||||
add_child(new_virtual_method_select);
|
||||
new_virtual_method_select->connect("selected", this, "_selected_new_virtual_method");
|
||||
new_virtual_method_select->get_cancel()->connect("pressed", this, "_selected_new_virtual_method");
|
||||
new_virtual_method_select->get_cancel();
|
||||
|
||||
member_popup = memnew(PopupMenu);
|
||||
add_child(member_popup);
|
||||
|
|
|
@ -176,7 +176,7 @@ class VisualScriptEditor : public ScriptEditorBase {
|
|||
|
||||
void _cancel_connect_node();
|
||||
void _create_new_node(const String &p_text, const String &p_category, const Vector2 &p_point);
|
||||
void _selected_new_virtual_method(const String &p_text = String(""), const String &p_category = String(""), const bool p_connecting = true);
|
||||
void _selected_new_virtual_method(const String &p_text, const String &p_category, const bool p_connecting);
|
||||
|
||||
int error_line;
|
||||
|
||||
|
|
|
@ -2519,7 +2519,7 @@ void Tree::_gui_input(Ref<InputEvent> p_event) {
|
|||
pressing_for_editor = false;
|
||||
}
|
||||
|
||||
if (cache.click_type == Cache::CLICK_BUTTON) {
|
||||
if (cache.click_type == Cache::CLICK_BUTTON && cache.click_item != NULL) {
|
||||
// make sure in case of wrong reference after reconstructing whole TreeItems
|
||||
cache.click_item = get_item_at_position(cache.click_pos);
|
||||
emit_signal("button_pressed", cache.click_item, cache.click_column, cache.click_id);
|
||||
|
|
Loading…
Reference in New Issue