Skip to content

Commit cc84018

Browse files
committed
btdu.state: Skip mark handling during uningest
Wrap the allMarked check and marked.exclusive update in a static if block that only executes for IngestDirection.ingest. Fixes an assertion failure when deleting while having some paths marked.
1 parent 764cb24 commit cc84018

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

source/btdu/state.d

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -835,17 +835,23 @@ void populateOrUnpopulateBrowserPathsFromSharingGroup(IngestDirection direction)
835835
markTotalSamples -= samples;
836836

837837
// Check marks and update marked node (expert mode only)
838-
if (expert)
838+
// Only during ingest - uningest skips this because invalidateMark() is called
839+
// after deletion which resets marked.exclusive to 0. This avoids needing to
840+
// track whether allMarked was true at ingest time.
841+
static if (direction == IngestDirection.ingest)
839842
{
840-
foreach (i, ref path; paths)
841-
if (!group.pathData[i].path.getEffectiveMark())
842-
{
843-
allMarked = false;
844-
break;
845-
}
846-
847-
if (allMarked)
848-
applySamples(&marked, SampleType.exclusive);
843+
if (expert)
844+
{
845+
foreach (i, ref path; paths)
846+
if (!group.pathData[i].path.getEffectiveMark())
847+
{
848+
allMarked = false;
849+
break;
850+
}
851+
852+
if (allMarked)
853+
applySamples(&marked, SampleType.exclusive);
854+
}
849855
}
850856
}
851857

0 commit comments

Comments
 (0)