From f8ab79e68af20e18e1d868b64d6dfd0c429bc554 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Mon, 4 Apr 2022 15:06:57 +0200 Subject: Zero initialize all pointer class and struct members This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr. --- editor/connections_dialog.h | 50 ++++++++++++++++++++++----------------------- 1 file changed, 25 insertions(+), 25 deletions(-) (limited to 'editor/connections_dialog.h') diff --git a/editor/connections_dialog.h b/editor/connections_dialog.h index 58c584b8b2..4b1b8363dd 100644 --- a/editor/connections_dialog.h +++ b/editor/connections_dialog.h @@ -105,27 +105,27 @@ public: }; private: - Label *connect_to_label; - LineEdit *from_signal; - Node *source; + Label *connect_to_label = nullptr; + LineEdit *from_signal = nullptr; + Node *source = nullptr; StringName signal; - LineEdit *dst_method; - ConnectDialogBinds *cdbinds; + LineEdit *dst_method = nullptr; + ConnectDialogBinds *cdbinds = nullptr; bool edit_mode; NodePath dst_path; - VBoxContainer *vbc_right; - - SceneTreeEditor *tree; - AcceptDialog *error; - SpinBox *unbind_count; - EditorInspector *bind_editor; - OptionButton *type_list; - CheckBox *deferred; - CheckBox *oneshot; - CheckButton *advanced; + VBoxContainer *vbc_right = nullptr; + + SceneTreeEditor *tree = nullptr; + AcceptDialog *error = nullptr; + SpinBox *unbind_count = nullptr; + EditorInspector *bind_editor = nullptr; + OptionButton *type_list = nullptr; + CheckBox *deferred = nullptr; + CheckBox *oneshot = nullptr; + CheckButton *advanced = nullptr; Vector bind_controls; - Label *error_label; + Label *error_label = nullptr; void ok_pressed() override; void _cancel_pressed(); @@ -186,16 +186,16 @@ class ConnectionsDock : public VBoxContainer { DISCONNECT }; - Node *selected_node; - ConnectionsDockTree *tree; + Node *selected_node = nullptr; + ConnectionsDockTree *tree = nullptr; - ConfirmationDialog *disconnect_all_dialog; - ConnectDialog *connect_dialog; - Button *connect_button; - PopupMenu *signal_menu; - PopupMenu *slot_menu; - UndoRedo *undo_redo; - LineEdit *search_box; + ConfirmationDialog *disconnect_all_dialog = nullptr; + ConnectDialog *connect_dialog = nullptr; + Button *connect_button = nullptr; + PopupMenu *signal_menu = nullptr; + PopupMenu *slot_menu = nullptr; + UndoRedo *undo_redo = nullptr; + LineEdit *search_box = nullptr; Map> descr_cache; -- cgit v1.2.3