mirror of
https://github.com/yse/easy_profiler.git
synced 2024-12-26 08:01:51 +08:00
#186 Prevent infinite loop
This commit is contained in:
parent
3104dd4ae7
commit
af758e204d
@ -374,9 +374,9 @@ const profiler::BlocksTree& TreeWidgetItem::block() const
|
|||||||
profiler::thread_id_t TreeWidgetItem::threadId() const
|
profiler::thread_id_t TreeWidgetItem::threadId() const
|
||||||
{
|
{
|
||||||
const QTreeWidgetItem* parentItem = this;
|
const QTreeWidgetItem* parentItem = this;
|
||||||
while (parentItem->parent() != nullptr)
|
while (parentItem != nullptr && parentItem->parent() != nullptr)
|
||||||
{
|
{
|
||||||
parentItem = parent();
|
parentItem = parentItem->parent();
|
||||||
}
|
}
|
||||||
return static_cast<profiler::thread_id_t>(parentItem->data(COL_NAME, Qt::UserRole).toULongLong());
|
return static_cast<profiler::thread_id_t>(parentItem->data(COL_NAME, Qt::UserRole).toULongLong());
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user