Add missing initializations for Node3DEditor.
Do not try to format fields with garbage values in _snap_update()
Initialize grid_enable[] before use.
Initialize previewing_camera before use.
These are all cases found live, with valgrind.
Fixes #76925
(cherry picked from commit 4bc513edbc
)
This commit is contained in:
parent
efbb28d09a
commit
ce0c61b6e3
|
@ -8340,8 +8340,6 @@ Node3DEditor::Node3DEditor() {
|
||||||
snap_scale->set_select_all_on_focus(true);
|
snap_scale->set_select_all_on_focus(true);
|
||||||
snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"), snap_scale);
|
snap_dialog_vbc->add_margin_child(TTR("Scale Snap (%):"), snap_scale);
|
||||||
|
|
||||||
_snap_update();
|
|
||||||
|
|
||||||
/* SETTINGS DIALOG */
|
/* SETTINGS DIALOG */
|
||||||
|
|
||||||
settings_dialog = memnew(ConfirmationDialog);
|
settings_dialog = memnew(ConfirmationDialog);
|
||||||
|
@ -8659,7 +8657,7 @@ void fragment() {
|
||||||
_load_default_preview_settings();
|
_load_default_preview_settings();
|
||||||
_preview_settings_changed();
|
_preview_settings_changed();
|
||||||
}
|
}
|
||||||
clear(); // Make sure values are initialized.
|
clear(); // Make sure values are initialized. Will call _snap_update() for us.
|
||||||
}
|
}
|
||||||
Node3DEditor::~Node3DEditor() {
|
Node3DEditor::~Node3DEditor() {
|
||||||
memdelete(preview_node);
|
memdelete(preview_node);
|
||||||
|
|
|
@ -402,8 +402,8 @@ private:
|
||||||
Camera3D *previewing = nullptr;
|
Camera3D *previewing = nullptr;
|
||||||
Camera3D *preview = nullptr;
|
Camera3D *preview = nullptr;
|
||||||
|
|
||||||
bool previewing_camera;
|
bool previewing_camera = false;
|
||||||
bool previewing_cinema;
|
bool previewing_cinema = false;
|
||||||
bool _is_node_locked(const Node *p_node);
|
bool _is_node_locked(const Node *p_node);
|
||||||
void _preview_exited_scene();
|
void _preview_exited_scene();
|
||||||
void _toggle_camera_preview(bool);
|
void _toggle_camera_preview(bool);
|
||||||
|
@ -580,8 +580,8 @@ private:
|
||||||
bool origin_enabled = false;
|
bool origin_enabled = false;
|
||||||
RID grid[3];
|
RID grid[3];
|
||||||
RID grid_instance[3];
|
RID grid_instance[3];
|
||||||
bool grid_visible[3]; //currently visible
|
bool grid_visible[3] = { false, false, false }; //currently visible
|
||||||
bool grid_enable[3]; //should be always visible if true
|
bool grid_enable[3] = { false, false, false }; //should be always visible if true
|
||||||
bool grid_enabled = false;
|
bool grid_enabled = false;
|
||||||
bool grid_init_draw = false;
|
bool grid_init_draw = false;
|
||||||
Camera3D::ProjectionType grid_camera_last_update_perspective = Camera3D::PROJECTION_PERSPECTIVE;
|
Camera3D::ProjectionType grid_camera_last_update_perspective = Camera3D::PROJECTION_PERSPECTIVE;
|
||||||
|
|
Loading…
Reference in New Issue