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/plugins/animation_player_editor_plugin.h | |
parent | 53317bbe146dd19a919685df8d846c55568daba1 (diff) |
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/plugins/animation_player_editor_plugin.h')
-rw-r--r-- | editor/plugins/animation_player_editor_plugin.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/editor/plugins/animation_player_editor_plugin.h b/editor/plugins/animation_player_editor_plugin.h index 5bb32e25e6..850751e47a 100644 --- a/editor/plugins/animation_player_editor_plugin.h +++ b/editor/plugins/animation_player_editor_plugin.h @@ -46,8 +46,8 @@ class AnimationPlayerEditorPlugin; class AnimationPlayerEditor : public VBoxContainer { GDCLASS(AnimationPlayerEditor, VBoxContainer); - AnimationPlayerEditorPlugin *plugin; - AnimationPlayer *player; + AnimationPlayerEditorPlugin *plugin = nullptr; + AnimationPlayer *player = nullptr; enum { TOOL_NEW_ANIM, @@ -88,31 +88,31 @@ class AnimationPlayerEditor : public VBoxContainer { RESOURCE_SAVE }; - OptionButton *animation; - Button *stop; - Button *play; - Button *play_from; - Button *play_bw; - Button *play_bw_from; - Button *autoplay; - - MenuButton *tool_anim; - Button *onion_toggle; - MenuButton *onion_skinning; - Button *pin; - SpinBox *frame; - LineEdit *scale; - LineEdit *name; - Label *name_title; - UndoRedo *undo_redo; + OptionButton *animation = nullptr; + Button *stop = nullptr; + Button *play = nullptr; + Button *play_from = nullptr; + Button *play_bw = nullptr; + Button *play_bw_from = nullptr; + Button *autoplay = nullptr; + + MenuButton *tool_anim = nullptr; + Button *onion_toggle = nullptr; + MenuButton *onion_skinning = nullptr; + Button *pin = nullptr; + SpinBox *frame = nullptr; + LineEdit *scale = nullptr; + LineEdit *name = nullptr; + Label *name_title = nullptr; + UndoRedo *undo_redo = nullptr; Ref<Texture2D> autoplay_icon; Ref<Texture2D> reset_icon; Ref<ImageTexture> autoplay_reset_icon; bool last_active; float timeline_position; - EditorFileDialog *file; - ConfirmationDialog *delete_dialog; + EditorFileDialog *file = nullptr; + ConfirmationDialog *delete_dialog = nullptr; struct BlendEditor { AcceptDialog *dialog = nullptr; @@ -121,14 +121,14 @@ class AnimationPlayerEditor : public VBoxContainer { } blend_editor; - ConfirmationDialog *name_dialog; - ConfirmationDialog *error_dialog; + ConfirmationDialog *name_dialog = nullptr; + ConfirmationDialog *error_dialog = nullptr; int name_dialog_op = TOOL_NEW_ANIM; bool updating; bool updating_blends; - AnimationTrackEditor *track_editor; + AnimationTrackEditor *track_editor = nullptr; static AnimationPlayerEditor *singleton; // Onion skinning. @@ -250,7 +250,7 @@ public: class AnimationPlayerEditorPlugin : public EditorPlugin { GDCLASS(AnimationPlayerEditorPlugin, EditorPlugin); - AnimationPlayerEditor *anim_editor; + AnimationPlayerEditor *anim_editor = nullptr; protected: void _notification(int p_what); |