diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 15:06:57 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-04-04 19:49:50 +0200 |
commit | f8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch) | |
tree | a9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/editor_audio_buses.h | |
parent | 53317bbe146dd19a919685df8d846c55568daba1 (diff) | |
download | redot-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/editor_audio_buses.h')
-rw-r--r-- | editor/editor_audio_buses.h | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/editor/editor_audio_buses.h b/editor/editor_audio_buses.h index 0020b61370..81a6e5b86d 100644 --- a/editor/editor_audio_buses.h +++ b/editor/editor_audio_buses.h @@ -52,9 +52,9 @@ class EditorAudioBus : public PanelContainer { GDCLASS(EditorAudioBus, PanelContainer); Ref<Texture2D> disabled_vu; - LineEdit *track_name; - MenuButton *bus_options; - VSlider *slider; + LineEdit *track_name = nullptr; + MenuButton *bus_options = nullptr; + VSlider *slider = nullptr; int cc; static const int CHANNELS_MAX = 4; @@ -69,21 +69,21 @@ class EditorAudioBus : public PanelContainer { TextureProgressBar *vu_r = nullptr; } channel[CHANNELS_MAX]; - OptionButton *send; + OptionButton *send = nullptr; - PopupMenu *effect_options; - PopupMenu *bus_popup; - PopupMenu *delete_effect_popup; + PopupMenu *effect_options = nullptr; + PopupMenu *bus_popup = nullptr; + PopupMenu *delete_effect_popup = nullptr; - Panel *audio_value_preview_box; - Label *audio_value_preview_label; - Timer *preview_timer; + Panel *audio_value_preview_box = nullptr; + Label *audio_value_preview_label = nullptr; + Timer *preview_timer = nullptr; - Button *solo; - Button *mute; - Button *bypass; + Button *solo = nullptr; + Button *mute = nullptr; + Button *bypass = nullptr; - Tree *effects; + Tree *effects = nullptr; bool updating_bus = false; bool is_master; @@ -121,7 +121,7 @@ class EditorAudioBus : public PanelContainer { friend class EditorAudioBuses; - EditorAudioBuses *buses; + EditorAudioBuses *buses = nullptr; protected: static void _bind_methods(); @@ -153,22 +153,22 @@ public: class EditorAudioBuses : public VBoxContainer { GDCLASS(EditorAudioBuses, VBoxContainer); - HBoxContainer *top_hb; + HBoxContainer *top_hb = nullptr; - ScrollContainer *bus_scroll; - HBoxContainer *bus_hb; + ScrollContainer *bus_scroll = nullptr; + HBoxContainer *bus_hb = nullptr; - EditorAudioBusDrop *drop_end; + EditorAudioBusDrop *drop_end = nullptr; - Label *file; + Label *file = nullptr; - Button *add; - Button *load; - Button *save_as; - Button *_default; - Button *_new; + Button *add = nullptr; + Button *load = nullptr; + Button *save_as = nullptr; + Button *_default = nullptr; + Button *_new = nullptr; - Timer *save_timer; + Timer *save_timer = nullptr; String edited_path; void _add_bus(); @@ -191,7 +191,7 @@ class EditorAudioBuses : public VBoxContainer { void _load_default_layout(); void _new_layout(); - EditorFileDialog *file_dialog; + EditorFileDialog *file_dialog = nullptr; bool new_layout; void _file_dialog_callback(const String &p_string); @@ -262,7 +262,7 @@ public: class AudioBusesEditorPlugin : public EditorPlugin { GDCLASS(AudioBusesEditorPlugin, EditorPlugin); - EditorAudioBuses *audio_bus_editor; + EditorAudioBuses *audio_bus_editor = nullptr; public: virtual String get_name() const override { return "SampleLibrary"; } |