You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +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:
@@ -45,10 +45,10 @@ class AcceptDialog : public Window {
|
||||
GDCLASS(AcceptDialog, Window);
|
||||
|
||||
Window *parent_visible = nullptr;
|
||||
Panel *bg;
|
||||
HBoxContainer *hbc;
|
||||
Label *label;
|
||||
Button *ok;
|
||||
Panel *bg = nullptr;
|
||||
HBoxContainer *hbc = nullptr;
|
||||
Label *label = nullptr;
|
||||
Button *ok = nullptr;
|
||||
bool hide_on_ok = true;
|
||||
bool close_on_escape = true;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
|
||||
class ConfirmationDialog : public AcceptDialog {
|
||||
GDCLASS(ConfirmationDialog, AcceptDialog);
|
||||
Button *cancel;
|
||||
Button *cancel = nullptr;
|
||||
|
||||
protected:
|
||||
static void _bind_methods();
|
||||
|
||||
Reference in New Issue
Block a user