chore(color): Replace dynamic_cast with virtual functions, disable RTTI to reduce FLASH usage (#3885)
* Replace dynamic_cast with virtual functions and disable RTTI. * Cleanup TopBar class hierarchy. * Fix compiler warning.
This commit is contained in:
@@ -37,6 +37,8 @@ class LuaWidgetFactory : public WidgetFactory
|
||||
Widget::PersistentData* persistentData,
|
||||
bool init = true) const override;
|
||||
|
||||
bool isLuaWidgetFactory() const override { return true; }
|
||||
|
||||
protected:
|
||||
void translateOptions(ZoneOption * options);
|
||||
|
||||
|
||||
@@ -376,7 +376,7 @@ void luaUnregisterWidgets()
|
||||
{
|
||||
std::list<const WidgetFactory *> regWidgets(getRegisteredWidgets());
|
||||
for (auto w : regWidgets) {
|
||||
if (dynamic_cast<const LuaWidgetFactory*>(w)) {
|
||||
if (w->isLuaWidgetFactory()) {
|
||||
delete w;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user