Commit 32227f2
committed
Fix Swift 6.1 strict concurrency errors in timer/callback bridging
Task closures that captured self from non-isolated callbacks
(Timer.scheduledTimer, VTCompressionSession output, SCStream output)
were failing on Swift 6.1 with "reference to captured var 'self' in
concurrently-executing code". Explicitly recapture with [weak self] at
the Task boundary.
FrameOutputStream also needed an UncheckedSendableBox wrapper to pass
CMSampleBuffer (non-Sendable) from the compression callback into a
MainActor Task without a sending warning.
Verified with swift build locally; Swift 6.3 was lenient about the
original patterns but Swift 6.1 on the CI runner was not.1 parent dd16a30 commit 32227f2
3 files changed
Lines changed: 13 additions & 6 deletions
File tree
- Sources/VirtualDisplayKit/Core
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
288 | 288 | | |
289 | 289 | | |
290 | 290 | | |
291 | | - | |
| 291 | + | |
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
209 | 209 | | |
210 | 210 | | |
211 | 211 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
15 | 22 | | |
16 | 23 | | |
17 | 24 | | |
| |||
365 | 372 | | |
366 | 373 | | |
367 | 374 | | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
372 | 379 | | |
373 | 380 | | |
374 | 381 | | |
| |||
0 commit comments