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.
This commit is contained in:
Rémi Verschelde
2022-04-04 15:06:57 +02:00
parent 53317bbe14
commit f8ab79e68a
258 changed files with 2398 additions and 2421 deletions

View File

@ -45,13 +45,13 @@ class EditorSettingsDialog : public AcceptDialog {
bool updating = false;
TabContainer *tabs;
Control *tab_general;
Control *tab_shortcuts;
TabContainer *tabs = nullptr;
Control *tab_general = nullptr;
Control *tab_shortcuts = nullptr;
LineEdit *search_box;
LineEdit *shortcut_search_box;
SectionedInspector *inspector;
LineEdit *search_box = nullptr;
LineEdit *shortcut_search_box = nullptr;
SectionedInspector *inspector = nullptr;
// Shortcuts
enum ShortcutButton {
@ -61,19 +61,19 @@ class EditorSettingsDialog : public AcceptDialog {
SHORTCUT_REVERT
};
Tree *shortcuts;
Tree *shortcuts = nullptr;
String shortcut_filter;
InputEventConfigurationDialog *shortcut_editor;
InputEventConfigurationDialog *shortcut_editor = nullptr;
bool is_editing_action = false;
String current_edited_identifier;
Array current_events;
int current_event_index = -1;
Timer *timer;
Timer *timer = nullptr;
UndoRedo *undo_redo;
UndoRedo *undo_redo = nullptr;
virtual void cancel_pressed() override;
virtual void ok_pressed() override;
@ -110,10 +110,10 @@ class EditorSettingsDialog : public AcceptDialog {
static void _undo_redo_callback(void *p_self, const String &p_name);
Label *restart_label;
TextureRect *restart_icon;
PanelContainer *restart_container;
Button *restart_close_button;
Label *restart_label = nullptr;
TextureRect *restart_icon = nullptr;
PanelContainer *restart_container = nullptr;
Button *restart_close_button = nullptr;
void _editor_restart_request();
void _editor_restart();