Clear links when making UI nodes
This commit is contained in:
@@ -283,15 +283,15 @@ static void pruneStale(BzUI *ui, BzUINode *node) {
|
|||||||
while (child != NULL) {
|
while (child != NULL) {
|
||||||
if (child->lastFrame != node->lastFrame) {
|
if (child->lastFrame != node->lastFrame) {
|
||||||
BzUINode *next = child->next;
|
BzUINode *next = child->next;
|
||||||
removeNode(ui, child);
|
if (child->prev)
|
||||||
if (child->prev) {
|
|
||||||
child->prev->next = next;
|
child->prev->next = next;
|
||||||
}
|
removeNode(ui, child);
|
||||||
|
if (next)
|
||||||
|
next->prev = child;
|
||||||
child = next;
|
child = next;
|
||||||
} else {
|
} else {
|
||||||
if (!first) {
|
if (!first)
|
||||||
first = child;
|
first = child;
|
||||||
}
|
|
||||||
pruneStale(ui, child);
|
pruneStale(ui, child);
|
||||||
last = child;
|
last = child;
|
||||||
child = child->next;
|
child = child->next;
|
||||||
@@ -402,6 +402,8 @@ BzUINode *bzUINodeMake(BzUI *ui, BzUIKey key, const BzUINodeDesc *desc) {
|
|||||||
BzUINode *parent = bzArrayGet(ui->nodeStack, bzArraySize(ui->nodeStack) - 1);
|
BzUINode *parent = bzArrayGet(ui->nodeStack, bzArraySize(ui->nodeStack) - 1);
|
||||||
BZ_ASSERT(parent);
|
BZ_ASSERT(parent);
|
||||||
|
|
||||||
|
bzUINodeClearLinks(node);
|
||||||
|
|
||||||
if (parent->last) {
|
if (parent->last) {
|
||||||
parent->last->next = node;
|
parent->last->next = node;
|
||||||
node->prev = parent->last;
|
node->prev = parent->last;
|
||||||
|
|||||||
Reference in New Issue
Block a user