summaryrefslogtreecommitdiffstats
path: root/editor/groups_editor.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/groups_editor.h
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
downloadredot-engine-f8ab79e68af20e18e1d868b64d6dfd0c429bc554.tar.gz
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/groups_editor.h')
-rw-r--r--editor/groups_editor.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/editor/groups_editor.h b/editor/groups_editor.h
index aa70ac5bc4..b6a6204013 100644
--- a/editor/groups_editor.h
+++ b/editor/groups_editor.h
@@ -43,32 +43,32 @@
class GroupDialog : public AcceptDialog {
GDCLASS(GroupDialog, AcceptDialog);
- ConfirmationDialog *error;
+ ConfirmationDialog *error = nullptr;
- SceneTree *scene_tree;
- TreeItem *groups_root;
+ SceneTree *scene_tree = nullptr;
+ TreeItem *groups_root = nullptr;
- LineEdit *add_group_text;
- Button *add_group_button;
+ LineEdit *add_group_text = nullptr;
+ Button *add_group_button = nullptr;
- Tree *groups;
+ Tree *groups = nullptr;
- Tree *nodes_to_add;
- TreeItem *add_node_root;
- LineEdit *add_filter;
+ Tree *nodes_to_add = nullptr;
+ TreeItem *add_node_root = nullptr;
+ LineEdit *add_filter = nullptr;
- Tree *nodes_to_remove;
- TreeItem *remove_node_root;
- LineEdit *remove_filter;
+ Tree *nodes_to_remove = nullptr;
+ TreeItem *remove_node_root = nullptr;
+ LineEdit *remove_filter = nullptr;
- Label *group_empty;
+ Label *group_empty = nullptr;
- Button *add_button;
- Button *remove_button;
+ Button *add_button = nullptr;
+ Button *remove_button = nullptr;
String selected_group;
- UndoRedo *undo_redo;
+ UndoRedo *undo_redo = nullptr;
void _group_selected();
@@ -111,15 +111,15 @@ public:
class GroupsEditor : public VBoxContainer {
GDCLASS(GroupsEditor, VBoxContainer);
- Node *node;
+ Node *node = nullptr;
- GroupDialog *group_dialog;
+ GroupDialog *group_dialog = nullptr;
- LineEdit *group_name;
- Button *add;
- Tree *tree;
+ LineEdit *group_name = nullptr;
+ Button *add = nullptr;
+ Tree *tree = nullptr;
- UndoRedo *undo_redo;
+ UndoRedo *undo_redo = nullptr;
void update_tree();
void _add_group(const String &p_group = "");