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/script_create_dialog.h | 44 +++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) (limited to 'editor/script_create_dialog.h') diff --git a/editor/script_create_dialog.h b/editor/script_create_dialog.h index e9f634e2c0..c7d8cfc38a 100644 --- a/editor/script_create_dialog.h +++ b/editor/script_create_dialog.h @@ -45,27 +45,27 @@ class EditorFileDialog; class ScriptCreateDialog : public ConfirmationDialog { GDCLASS(ScriptCreateDialog, ConfirmationDialog); - LineEdit *class_name; - Label *error_label; - Label *path_error_label; - Label *builtin_warning_label; - Label *script_name_warning_label; - Label *template_info_label; - PanelContainer *status_panel; - LineEdit *parent_name; - Button *parent_browse_button; - Button *parent_search_button; - OptionButton *language_menu; - OptionButton *template_menu; - LineEdit *file_path; - LineEdit *internal_name; - Button *path_button; - EditorFileDialog *file_browse; - CheckBox *internal; - CheckBox *use_templates; - VBoxContainer *path_vb; - AcceptDialog *alert; - CreateDialog *select_class; + LineEdit *class_name = nullptr; + Label *error_label = nullptr; + Label *path_error_label = nullptr; + Label *builtin_warning_label = nullptr; + Label *script_name_warning_label = nullptr; + Label *template_info_label = nullptr; + PanelContainer *status_panel = nullptr; + LineEdit *parent_name = nullptr; + Button *parent_browse_button = nullptr; + Button *parent_search_button = nullptr; + OptionButton *language_menu = nullptr; + OptionButton *template_menu = nullptr; + LineEdit *file_path = nullptr; + LineEdit *internal_name = nullptr; + Button *path_button = nullptr; + EditorFileDialog *file_browse = nullptr; + CheckBox *internal = nullptr; + CheckBox *use_templates = nullptr; + VBoxContainer *path_vb = nullptr; + AcceptDialog *alert = nullptr; + CreateDialog *select_class = nullptr; bool is_browsing_parent = false; String template_inactive_message; String initial_bp; @@ -89,7 +89,7 @@ class ScriptCreateDialog : public ConfirmationDialog { Control *name_controls[2]; Vector template_list; - ScriptLanguage *language; + ScriptLanguage *language = nullptr; String base_type; -- cgit v1.2.3