mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-08-21 13:39:09 +00:00
Fix: TextfileWindow called virtual methods before constructor completed. (#11889)
SetStringParameters() was called during widget tree init in the constructor. Calls within a constructor cannot call the derived classes methods. This would result in invalid data being passed to the string system, which could then crash.
This commit is contained in:
@@ -59,6 +59,8 @@ static std::optional<std::string> FindGameManualFilePath(std::string_view filena
|
||||
struct GameManualTextfileWindow : public TextfileWindow {
|
||||
GameManualTextfileWindow(std::string_view filename) : TextfileWindow(TFT_GAME_MANUAL)
|
||||
{
|
||||
this->ConstructWindow();
|
||||
|
||||
/* Mark the content of these files as trusted. */
|
||||
this->trusted = true;
|
||||
|
||||
|
Reference in New Issue
Block a user