Commit 8386f5d
committed
fix: add ScopeGuard to wait async tasks before early return in Clean()
When GetUsedFiles() returns an error (e.g. index manifest not supported),
Clean() would return immediately while thread pool tasks submitted via
Via(executor_.get(), ...) were still running. These tasks capture 'this'
and access members like fs_, causing use-after-free when the
OrphanFilesCleanerImpl is destroyed shortly after.
Add a ScopeGuard that calls CollectAll(file_statuses_futures) to ensure
all submitted async tasks complete before the function returns, preventing
the intermittent segmentation fault.1 parent 7a2c831 commit 8386f5d
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
100 | 102 | | |
101 | 103 | | |
102 | 104 | | |
| |||
0 commit comments