fix(color): widget Lua 'update' function may give unexpected error (#7119)
This commit is contained in:
@@ -203,8 +203,6 @@ void Widget::onCancel()
|
||||
if (!fullscreen) ButtonBase::onCancel();
|
||||
}
|
||||
|
||||
void Widget::update() {}
|
||||
|
||||
void Widget::setFullscreen(bool enable)
|
||||
{
|
||||
if (!!parent->isTopBar() || (enable == fullscreen)) return;
|
||||
@@ -252,7 +250,8 @@ void Widget::setFullscreen(bool enable)
|
||||
|
||||
onFullscreen(enable);
|
||||
|
||||
update();
|
||||
if (fullscreen)
|
||||
updateWithoutRefresh();
|
||||
}
|
||||
|
||||
bool Widget::onLongPress()
|
||||
|
||||
@@ -106,7 +106,8 @@ class Widget : public ButtonBase
|
||||
virtual bool enableFullScreenRE() const { return true; }
|
||||
|
||||
// Called when the widget options have changed
|
||||
virtual void update();
|
||||
virtual void updateWithoutRefresh() {}
|
||||
virtual void update() {}
|
||||
|
||||
// Called at regular time interval if the widget is hidden or off screen
|
||||
virtual void background() {}
|
||||
|
||||
@@ -220,6 +220,6 @@ WidgetSettings::WidgetSettings(Widget* w) :
|
||||
|
||||
void WidgetSettings::onCancel()
|
||||
{
|
||||
widget->update();
|
||||
widget->updateWithoutRefresh();
|
||||
deleteLater();
|
||||
}
|
||||
|
||||
@@ -196,8 +196,8 @@ void StandaloneLuaWindow::deleteLater()
|
||||
{
|
||||
if (_deleted) return;
|
||||
|
||||
if (initFunction != LUA_REFNIL) luaL_unref(lsStandalone, LUA_REGISTRYINDEX, initFunction);
|
||||
if (runFunction != LUA_REFNIL) luaL_unref(lsStandalone, LUA_REGISTRYINDEX, runFunction);
|
||||
luaL_unref(lsStandalone, LUA_REGISTRYINDEX, initFunction);
|
||||
luaL_unref(lsStandalone, LUA_REGISTRYINDEX, runFunction);
|
||||
luaLcdBuffer = nullptr;
|
||||
|
||||
luaClose(&lsStandalone);
|
||||
|
||||
Reference in New Issue
Block a user