Use dynamic_cast for safety in eeconfig()
Calling config() gets you whatever APP_SETTINGS_BASE is returned by the underlying kiface, which is currently going to be an EESCHEMA_SETTINGS everywhere this is used, but that isn't a guarantee.
This commit is contained in:
parent
108cf23892
commit
0d654b3574
|
@ -114,7 +114,7 @@ public:
|
|||
SCH_SCREEN* GetScreen() const override;
|
||||
void SetScreen( BASE_SCREEN* aScreen ) override;
|
||||
|
||||
EESCHEMA_SETTINGS* eeconfig() const { return static_cast<EESCHEMA_SETTINGS*>( config() ); }
|
||||
EESCHEMA_SETTINGS* eeconfig() const { return dynamic_cast<EESCHEMA_SETTINGS*>( config() ); }
|
||||
|
||||
void LoadSettings( APP_SETTINGS_BASE* aCfg ) override;
|
||||
void SaveSettings( APP_SETTINGS_BASE* aCfg ) override;
|
||||
|
|
Loading…
Reference in New Issue