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:
Eduardo Bart
2012-03-22 18:47:52 -03:00
parent 159eb98df2
commit 33458a3e39
41 changed files with 335 additions and 234 deletions

View File

@@ -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
}