You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2026-01-05 19:31:35 +00:00
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:
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
class EditorPropertyAnchorsPreset : public EditorProperty {
|
||||
GDCLASS(EditorPropertyAnchorsPreset, EditorProperty);
|
||||
OptionButton *options;
|
||||
OptionButton *options = nullptr;
|
||||
|
||||
void _option_selected(int p_which);
|
||||
|
||||
@@ -94,9 +94,9 @@ class EditorPropertySizeFlags : public EditorProperty {
|
||||
SIZE_FLAGS_PRESET_CUSTOM,
|
||||
};
|
||||
|
||||
OptionButton *flag_presets;
|
||||
CheckBox *flag_expand;
|
||||
VBoxContainer *flag_options;
|
||||
OptionButton *flag_presets = nullptr;
|
||||
CheckBox *flag_expand = nullptr;
|
||||
VBoxContainer *flag_options = nullptr;
|
||||
Vector<CheckBox *> flag_checks;
|
||||
|
||||
bool vertical = false;
|
||||
@@ -128,8 +128,8 @@ public:
|
||||
class ControlEditorToolbar : public HBoxContainer {
|
||||
GDCLASS(ControlEditorToolbar, HBoxContainer);
|
||||
|
||||
UndoRedo *undo_redo;
|
||||
EditorSelection *editor_selection;
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
EditorSelection *editor_selection = nullptr;
|
||||
|
||||
enum MenuOption {
|
||||
ANCHORS_AND_OFFSETS_PRESET_TOP_LEFT,
|
||||
@@ -198,12 +198,12 @@ class ControlEditorToolbar : public HBoxContainer {
|
||||
CONTAINERS_V_PRESET_SHRINK_END,
|
||||
};
|
||||
|
||||
MenuButton *anchor_presets_menu;
|
||||
PopupMenu *anchors_popup;
|
||||
MenuButton *container_h_presets_menu;
|
||||
MenuButton *container_v_presets_menu;
|
||||
MenuButton *anchor_presets_menu = nullptr;
|
||||
PopupMenu *anchors_popup = nullptr;
|
||||
MenuButton *container_h_presets_menu = nullptr;
|
||||
MenuButton *container_v_presets_menu = nullptr;
|
||||
|
||||
Button *anchor_mode_button;
|
||||
Button *anchor_mode_button = nullptr;
|
||||
|
||||
bool anchors_mode = false;
|
||||
|
||||
@@ -239,7 +239,7 @@ public:
|
||||
class ControlEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(ControlEditorPlugin, EditorPlugin);
|
||||
|
||||
ControlEditorToolbar *toolbar;
|
||||
ControlEditorToolbar *toolbar = nullptr;
|
||||
|
||||
public:
|
||||
virtual String get_name() const override { return "Control"; }
|
||||
|
||||
Reference in New Issue
Block a user