You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +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:
@@ -40,7 +40,7 @@
|
||||
class Path3DGizmo : public EditorNode3DGizmo {
|
||||
GDCLASS(Path3DGizmo, EditorNode3DGizmo);
|
||||
|
||||
Path3D *path;
|
||||
Path3D *path = nullptr;
|
||||
mutable Vector3 original;
|
||||
mutable float orig_in_length;
|
||||
mutable float orig_out_length;
|
||||
@@ -70,14 +70,14 @@ public:
|
||||
class Path3DEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(Path3DEditorPlugin, EditorPlugin);
|
||||
|
||||
Separator *sep;
|
||||
Button *curve_create;
|
||||
Button *curve_edit;
|
||||
Button *curve_del;
|
||||
Button *curve_close;
|
||||
MenuButton *handle_menu;
|
||||
Separator *sep = nullptr;
|
||||
Button *curve_create = nullptr;
|
||||
Button *curve_edit = nullptr;
|
||||
Button *curve_del = nullptr;
|
||||
Button *curve_close = nullptr;
|
||||
MenuButton *handle_menu = nullptr;
|
||||
|
||||
Path3D *path;
|
||||
Path3D *path = nullptr;
|
||||
|
||||
void _update_theme();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user