1
0
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:
Rémi Verschelde
2022-04-04 15:06:57 +02:00
parent 53317bbe14
commit f8ab79e68a
258 changed files with 2398 additions and 2421 deletions

View File

@@ -61,9 +61,9 @@ class CollisionShape2DEditor : public Control {
Point2(1, -1),
};
UndoRedo *undo_redo;
CanvasItemEditor *canvas_item_editor;
CollisionShape2D *node;
UndoRedo *undo_redo = nullptr;
CanvasItemEditor *canvas_item_editor = nullptr;
CollisionShape2D *node = nullptr;
Vector<Point2> handles;
@@ -96,7 +96,7 @@ public:
class CollisionShape2DEditorPlugin : public EditorPlugin {
GDCLASS(CollisionShape2DEditorPlugin, EditorPlugin);
CollisionShape2DEditor *collision_shape_2d_editor;
CollisionShape2DEditor *collision_shape_2d_editor = nullptr;
public:
virtual bool forward_canvas_gui_input(const Ref<InputEvent> &p_event) override { return collision_shape_2d_editor->forward_canvas_gui_input(p_event); }