You've already forked godot
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user