You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +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:
@@ -51,17 +51,17 @@ class MeshInstance3DEditor : public Control {
|
||||
MENU_OPTION_DEBUG_UV2,
|
||||
};
|
||||
|
||||
MeshInstance3D *node;
|
||||
MeshInstance3D *node = nullptr;
|
||||
|
||||
MenuButton *options;
|
||||
MenuButton *options = nullptr;
|
||||
|
||||
ConfirmationDialog *outline_dialog;
|
||||
SpinBox *outline_size;
|
||||
ConfirmationDialog *outline_dialog = nullptr;
|
||||
SpinBox *outline_size = nullptr;
|
||||
|
||||
AcceptDialog *err_dialog;
|
||||
AcceptDialog *err_dialog = nullptr;
|
||||
|
||||
AcceptDialog *debug_uv_dialog;
|
||||
Control *debug_uv;
|
||||
AcceptDialog *debug_uv_dialog = nullptr;
|
||||
Control *debug_uv = nullptr;
|
||||
Vector<Vector2> uv_lines;
|
||||
|
||||
void _menu_option(int p_option);
|
||||
@@ -84,7 +84,7 @@ public:
|
||||
class MeshInstance3DEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(MeshInstance3DEditorPlugin, EditorPlugin);
|
||||
|
||||
MeshInstance3DEditor *mesh_editor;
|
||||
MeshInstance3DEditor *mesh_editor = nullptr;
|
||||
|
||||
public:
|
||||
virtual String get_name() const override { return "MeshInstance3D"; }
|
||||
|
||||
Reference in New Issue
Block a user