mirror of
https://github.com/edubart/otclient.git
synced 2025-12-20 15:37:11 +01:00
modules changes
* speedup widget destruction checks * rework outfit module using grid layout and the new design * fixes in console, terminal, textmessage modules
This commit is contained in:
@@ -636,10 +636,8 @@ void UIWidget::destroy()
|
||||
g_ui.onWidgetDestroy(asUIWidget());
|
||||
|
||||
// remove itself from parent
|
||||
if(UIWidgetPtr parent = getParent()) {
|
||||
assert(parent->hasChild(asUIWidget()));
|
||||
if(UIWidgetPtr parent = getParent())
|
||||
parent->removeChild(asUIWidget());
|
||||
}
|
||||
|
||||
destroyChildren();
|
||||
m_focusedChild = nullptr;
|
||||
@@ -649,15 +647,7 @@ void UIWidget::destroy()
|
||||
releaseLuaFieldsTable();
|
||||
|
||||
#ifdef DEBUG
|
||||
auto self = asUIWidget();
|
||||
g_lua.collectGarbage();
|
||||
if(self != g_ui.getRootWidget()) {
|
||||
g_eventDispatcher.scheduleEvent([self] {
|
||||
g_lua.collectGarbage();
|
||||
if(self->getUseCount() != 1)
|
||||
logWarning("widget '", self->getId(), "' destroyed but still have ", self->getUseCount()-1, " reference(s) left");
|
||||
}, 500);
|
||||
}
|
||||
g_ui.addDestroyedWidget(asUIWidget());
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user