summaryrefslogtreecommitdiff
path: root/editor/plugins/theme_editor_preview.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/theme_editor_preview.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/theme_editor_preview.h')
-rw-r--r--editor/plugins/theme_editor_preview.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/plugins/theme_editor_preview.h b/editor/plugins/theme_editor_preview.h
index 48111df399..d05916afae 100644
--- a/editor/plugins/theme_editor_preview.h
+++ b/editor/plugins/theme_editor_preview.h
@@ -41,10 +41,10 @@
class ThemeEditorPreview : public VBoxContainer {
GDCLASS(ThemeEditorPreview, VBoxContainer);
- ScrollContainer *preview_container;
- ColorRect *preview_bg;
- MarginContainer *preview_overlay;
- Control *picker_overlay;
+ ScrollContainer *preview_container = nullptr;
+ ColorRect *preview_bg = nullptr;
+ MarginContainer *preview_overlay = nullptr;
+ Control *picker_overlay = nullptr;
Control *hovered_control = nullptr;
struct ThemeCache {
@@ -69,9 +69,9 @@ class ThemeEditorPreview : public VBoxContainer {
void _reset_picker_overlay();
protected:
- HBoxContainer *preview_toolbar;
- MarginContainer *preview_content;
- Button *picker_button;
+ HBoxContainer *preview_toolbar = nullptr;
+ MarginContainer *preview_content = nullptr;
+ Button *picker_button = nullptr;
void add_preview_overlay(Control *p_overlay);
@@ -96,7 +96,7 @@ class SceneThemeEditorPreview : public ThemeEditorPreview {
Ref<PackedScene> loaded_scene;
- Button *reload_scene_button;
+ Button *reload_scene_button = nullptr;
void _reload_scene();