You've already forked godot
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:
@@ -47,16 +47,16 @@ class ResourcePreloaderEditor : public PanelContainer {
|
||||
BUTTON_REMOVE
|
||||
};
|
||||
|
||||
Button *load;
|
||||
Button *paste;
|
||||
Tree *tree;
|
||||
Button *load = nullptr;
|
||||
Button *paste = nullptr;
|
||||
Tree *tree = nullptr;
|
||||
bool loading_scene;
|
||||
|
||||
EditorFileDialog *file;
|
||||
EditorFileDialog *file = nullptr;
|
||||
|
||||
AcceptDialog *dialog;
|
||||
AcceptDialog *dialog = nullptr;
|
||||
|
||||
ResourcePreloader *preloader;
|
||||
ResourcePreloader *preloader = nullptr;
|
||||
|
||||
void _load_pressed();
|
||||
void _files_load_request(const Vector<String> &p_paths);
|
||||
@@ -66,7 +66,7 @@ class ResourcePreloaderEditor : public PanelContainer {
|
||||
void _cell_button_pressed(Object *p_item, int p_column, int p_id);
|
||||
void _item_edited();
|
||||
|
||||
UndoRedo *undo_redo;
|
||||
UndoRedo *undo_redo = nullptr;
|
||||
|
||||
Variant get_drag_data_fw(const Point2 &p_point, Control *p_from);
|
||||
bool can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const;
|
||||
@@ -87,8 +87,8 @@ public:
|
||||
class ResourcePreloaderEditorPlugin : public EditorPlugin {
|
||||
GDCLASS(ResourcePreloaderEditorPlugin, EditorPlugin);
|
||||
|
||||
ResourcePreloaderEditor *preloader_editor;
|
||||
Button *button;
|
||||
ResourcePreloaderEditor *preloader_editor = nullptr;
|
||||
Button *button = nullptr;
|
||||
|
||||
public:
|
||||
virtual String get_name() const override { return "ResourcePreloader"; }
|
||||
|
||||
Reference in New Issue
Block a user