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/project_export.h | 74 ++++++++++++++++++++++++------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) (limited to 'editor/project_export.h') diff --git a/editor/project_export.h b/editor/project_export.h index 057fd31168..4d1719d6eb 100644 --- a/editor/project_export.h +++ b/editor/project_export.h @@ -58,46 +58,46 @@ class ProjectExportDialog : public ConfirmationDialog { GDCLASS(ProjectExportDialog, ConfirmationDialog); private: - TabContainer *sections; + TabContainer *sections = nullptr; - MenuButton *add_preset; - Button *duplicate_preset; - Button *delete_preset; - ItemList *presets; + MenuButton *add_preset = nullptr; + Button *duplicate_preset = nullptr; + Button *delete_preset = nullptr; + ItemList *presets = nullptr; - LineEdit *name; - EditorPropertyPath *export_path; - EditorInspector *parameters; - CheckButton *runnable; + LineEdit *name = nullptr; + EditorPropertyPath *export_path = nullptr; + EditorInspector *parameters = nullptr; + CheckButton *runnable = nullptr; - Button *button_export; + Button *button_export = nullptr; bool updating = false; - AcceptDialog *error_dialog; - ConfirmationDialog *delete_confirm; + AcceptDialog *error_dialog = nullptr; + ConfirmationDialog *delete_confirm = nullptr; - OptionButton *export_filter; - LineEdit *include_filters; - LineEdit *exclude_filters; - Tree *include_files; + OptionButton *export_filter = nullptr; + LineEdit *include_filters = nullptr; + LineEdit *exclude_filters = nullptr; + Tree *include_files = nullptr; - Label *include_label; - MarginContainer *include_margin; + Label *include_label = nullptr; + MarginContainer *include_margin = nullptr; - Button *export_button; - Button *export_all_button; - AcceptDialog *export_all_dialog; + Button *export_button = nullptr; + Button *export_all_button = nullptr; + AcceptDialog *export_all_dialog = nullptr; - LineEdit *custom_features; - RichTextLabel *custom_feature_display; + LineEdit *custom_features = nullptr; + RichTextLabel *custom_feature_display = nullptr; - OptionButton *script_mode; - LineEdit *script_key; - Label *script_key_error; + OptionButton *script_mode = nullptr; + LineEdit *script_key = nullptr; + Label *script_key_error = nullptr; - Label *export_error; - Label *export_warning; - HBoxContainer *export_templates_error; + Label *export_error = nullptr; + Label *export_warning = nullptr; + HBoxContainer *export_templates_error = nullptr; String default_filename; @@ -127,15 +127,15 @@ private: bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const; void drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from); - EditorFileDialog *export_pck_zip; - EditorFileDialog *export_project; - CheckBox *export_debug; - CheckBox *export_pck_zip_debug; + EditorFileDialog *export_pck_zip = nullptr; + EditorFileDialog *export_project = nullptr; + CheckBox *export_debug = nullptr; + CheckBox *export_pck_zip_debug = nullptr; - CheckButton *enc_pck; - CheckButton *enc_directory; - LineEdit *enc_in_filters; - LineEdit *enc_ex_filters; + CheckButton *enc_pck = nullptr; + CheckButton *enc_directory = nullptr; + LineEdit *enc_in_filters = nullptr; + LineEdit *enc_ex_filters = nullptr; void _open_export_template_manager(); -- cgit v1.2.3