1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +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

@@ -40,9 +40,9 @@ class CanvasItemEditor;
class AbstractPolygon2DEditor : public HBoxContainer {
GDCLASS(AbstractPolygon2DEditor, HBoxContainer);
Button *button_create;
Button *button_edit;
Button *button_delete;
Button *button_create = nullptr;
Button *button_edit = nullptr;
Button *button_delete = nullptr;
struct Vertex {
Vertex() {}
@@ -85,9 +85,9 @@ class AbstractPolygon2DEditor : public HBoxContainer {
bool _polygon_editing_enabled;
CanvasItemEditor *canvas_item_editor;
Panel *panel;
ConfirmationDialog *create_resource;
CanvasItemEditor *canvas_item_editor = nullptr;
Panel *panel = nullptr;
ConfirmationDialog *create_resource = nullptr;
protected:
enum {
@@ -99,7 +99,7 @@ protected:
int mode;
UndoRedo *undo_redo;
UndoRedo *undo_redo = nullptr;
virtual void _menu_option(int p_option);
void _wip_changed();
@@ -149,7 +149,7 @@ public:
class AbstractPolygon2DEditorPlugin : public EditorPlugin {
GDCLASS(AbstractPolygon2DEditorPlugin, EditorPlugin);
AbstractPolygon2DEditor *polygon_editor;
AbstractPolygon2DEditor *polygon_editor = nullptr;
String klass;
public: