Codechange: explicitly initialise member variables of Windows
This commit is contained in:
@@ -544,10 +544,8 @@ void ShowLinkGraphLegend()
|
||||
AllocateWindowDescFront<LinkGraphLegendWindow>(_linkgraph_legend_desc, 0);
|
||||
}
|
||||
|
||||
LinkGraphLegendWindow::LinkGraphLegendWindow(WindowDesc &desc, int window_number) : Window(desc)
|
||||
LinkGraphLegendWindow::LinkGraphLegendWindow(WindowDesc &desc, int window_number) : Window(desc), num_cargo(_sorted_cargo_specs.size())
|
||||
{
|
||||
this->num_cargo = _sorted_cargo_specs.size();
|
||||
|
||||
this->InitNested(window_number);
|
||||
this->InvalidateData(0);
|
||||
this->SetOverlay(GetMainWindow()->viewport->overlay);
|
||||
|
||||
@@ -115,8 +115,8 @@ public:
|
||||
void OnInvalidateData(int data = 0, bool gui_scope = true) override;
|
||||
|
||||
private:
|
||||
std::shared_ptr<LinkGraphOverlay> overlay;
|
||||
size_t num_cargo;
|
||||
std::shared_ptr<LinkGraphOverlay> overlay{};
|
||||
size_t num_cargo = 0;
|
||||
|
||||
void UpdateOverlayCompanies();
|
||||
void UpdateOverlayCargoes();
|
||||
|
||||
Reference in New Issue
Block a user