summaryrefslogtreecommitdiff
path: root/editor/connections_dialog.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/connections_dialog.h
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
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.
Diffstat (limited to 'editor/connections_dialog.h')
-rw-r--r--editor/connections_dialog.h50
1 files changed, 25 insertions, 25 deletions
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<Control *> 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<StringName, Map<StringName, String>> descr_cache;