summaryrefslogtreecommitdiff
path: root/editor/plugins/shader_editor_plugin.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/plugins/shader_editor_plugin.h
parent53317bbe146dd19a919685df8d846c55568daba1 (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/shader_editor_plugin.h')
-rw-r--r--editor/plugins/shader_editor_plugin.h22
1 files changed, 11 insertions, 11 deletions
diff --git a/editor/plugins/shader_editor_plugin.h b/editor/plugins/shader_editor_plugin.h
index 600b14362e..067711c75c 100644
--- a/editor/plugins/shader_editor_plugin.h
+++ b/editor/plugins/shader_editor_plugin.h
@@ -108,19 +108,19 @@ class ShaderEditor : public PanelContainer {
HELP_DOCS,
};
- MenuButton *edit_menu;
- MenuButton *search_menu;
- PopupMenu *bookmarks_menu;
- MenuButton *help_menu;
- PopupMenu *context_menu;
+ MenuButton *edit_menu = nullptr;
+ MenuButton *search_menu = nullptr;
+ PopupMenu *bookmarks_menu = nullptr;
+ MenuButton *help_menu = nullptr;
+ PopupMenu *context_menu = nullptr;
RichTextLabel *warnings_panel = nullptr;
uint64_t idle;
- GotoLineDialog *goto_line_dialog;
- ConfirmationDialog *erase_tab_confirm;
- ConfirmationDialog *disk_changed;
+ GotoLineDialog *goto_line_dialog = nullptr;
+ ConfirmationDialog *erase_tab_confirm = nullptr;
+ ConfirmationDialog *disk_changed = nullptr;
- ShaderTextEditor *shader_editor;
+ ShaderTextEditor *shader_editor = nullptr;
void _menu_option(int p_option);
mutable Ref<Shader> shader;
@@ -161,8 +161,8 @@ class ShaderEditorPlugin : public EditorPlugin {
GDCLASS(ShaderEditorPlugin, EditorPlugin);
bool _2d;
- ShaderEditor *shader_editor;
- Button *button;
+ ShaderEditor *shader_editor = nullptr;
+ Button *button = nullptr;
public:
virtual String get_name() const override { return "Shader"; }