Codechange: Use a shared_ptr for viewport overlay. (#10586)
This commit is contained in:
@@ -108,7 +108,7 @@ void ShowLinkGraphLegend();
|
||||
struct LinkGraphLegendWindow : Window {
|
||||
public:
|
||||
LinkGraphLegendWindow(WindowDesc *desc, int window_number);
|
||||
void SetOverlay(LinkGraphOverlay *overlay);
|
||||
void SetOverlay(std::shared_ptr<LinkGraphOverlay> overlay);
|
||||
|
||||
void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override;
|
||||
void DrawWidget(const Rect &r, int widget) const override;
|
||||
@@ -117,7 +117,7 @@ public:
|
||||
void OnInvalidateData(int data = 0, bool gui_scope = true) override;
|
||||
|
||||
private:
|
||||
LinkGraphOverlay *overlay;
|
||||
std::shared_ptr<LinkGraphOverlay> overlay;
|
||||
|
||||
void UpdateOverlayCompanies();
|
||||
void UpdateOverlayCargoes();
|
||||
|
Reference in New Issue
Block a user