You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-19 14:31:59 +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:
@@ -55,22 +55,22 @@ class CPUParticles2DEditorPlugin : public EditorPlugin {
|
||||
EMISSION_MODE_BORDER_DIRECTED
|
||||
};
|
||||
|
||||
CPUParticles2D *particles;
|
||||
CPUParticles2D *particles = nullptr;
|
||||
|
||||
EditorFileDialog *file;
|
||||
EditorFileDialog *file = nullptr;
|
||||
|
||||
HBoxContainer *toolbar;
|
||||
MenuButton *menu;
|
||||
HBoxContainer *toolbar = nullptr;
|
||||
MenuButton *menu = nullptr;
|
||||
|
||||
SpinBox *epoints;
|
||||
SpinBox *epoints = nullptr;
|
||||
|
||||
ConfirmationDialog *emission_mask;
|
||||
OptionButton *emission_mask_mode;
|
||||
CheckBox *emission_colors;
|
||||
ConfirmationDialog *emission_mask = nullptr;
|
||||
OptionButton *emission_mask_mode = nullptr;
|
||||
CheckBox *emission_colors = nullptr;
|
||||
|
||||
String source_emission_file;
|
||||
|
||||
UndoRedo *undo_redo;
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
void _file_selected(const String &p_file);
|
||||
void _menu_callback(int p_idx);
|
||||
void _generate_emission_mask();
|
||||
|
||||
Reference in New Issue
Block a user