mirror of
https://github.com/samsonjs/SJSAssetExportSession.git
synced 2026-04-27 14:57:46 +00:00
Make yielding last progress value more reliable
This commit is contained in:
parent
4966910a3b
commit
aaaf227c96
1 changed files with 6 additions and 1 deletions
|
|
@ -131,10 +131,15 @@ actor SampleWriter {
|
||||||
}
|
}
|
||||||
|
|
||||||
progressContinuation?.yield(1.0)
|
progressContinuation?.yield(1.0)
|
||||||
progressContinuation?.finish()
|
|
||||||
|
|
||||||
// Make sure the last progress value is yielded before returning.
|
// Make sure the last progress value is yielded before returning.
|
||||||
await Task.yield()
|
await Task.yield()
|
||||||
|
await withCheckedContinuation { continuation in
|
||||||
|
progressContinuation?.onTermination = { _ in
|
||||||
|
continuation.resume(returning: ())
|
||||||
|
}
|
||||||
|
progressContinuation?.finish()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// MARK: - Setup
|
// MARK: - Setup
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue