Skip to content

Commit

Permalink
Qt: fix flow_layout segfault
Browse files Browse the repository at this point in the history
  • Loading branch information
Megamouse committed Dec 19, 2024
1 parent 9d4ff13 commit 79fc366
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion rpcs3/rpcs3qt/flow_layout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ flow_layout::~flow_layout()

void flow_layout::clear()
{
for (QLayoutItem* item : m_item_list)
// We can't use a ranged loop here, since deleting the widget will call takeAt on the layout. So let's also use takeAt.
while (QLayoutItem* item = takeAt(0))
{
if (item)
{
Expand Down

0 comments on commit 79fc366

Please sign in to comment.