qt-quick: initialize prev and next when adding chart items
The code assumed that when adding chart items to lists, prev and next are initialized to null. Make this more robust. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
parent
2c87a057cc
commit
bbfdf75283
@ -235,11 +235,13 @@ void ChartView::ChartItemList::remove(ChartItem &item)
|
||||
void ChartView::ChartItemList::append(ChartItem &item)
|
||||
{
|
||||
if (!first) {
|
||||
item.prev = nullptr;
|
||||
first = &item;
|
||||
} else {
|
||||
item.prev = last;
|
||||
last->next = &item;
|
||||
}
|
||||
item.next = nullptr;
|
||||
last = &item;
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user