You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I experience crashes with invalid NIL in the following function of Renderer.swift:
func selectBuffers(width: CGFloat) -> (MTLBuffer, MTLBuffer) {
var level = 0
for (minBuffer, maxBuffer) in zip(minBuffers, maxBuffers) {
if CGFloat(minBuffer.length / MemoryLayout<Float>.size) < width {
return (minBuffer, maxBuffer)
}
level += 1
}
**return (minBuffers.last!, maxBuffers.last!)**
}
I tried to reproduce this in debug mode, but I does not happen there - it happens only with the app compiled for run.
What I see is that in debug the drawing is much slower. So what I suspect is, that as I'm using SwiftUI redraws happen with empty buffers, which cause this.
BTW: thanks for this wonderful implementation of a waveform drawer!
Crash Logs, Screenshots or Other Attachments (if applicable)
I'm not sure if it's helpful but here is a partial crash log confirming this issue. As you mentioned it's only in the wild when built for release. However it's only happening for 1 of my testers.
Activity
atomhax commentedon Jul 10, 2023
I'm not sure if it's helpful but here is a partial crash log confirming this issue. As you mentioned it's only in the wild when built for release. However it's only happening for 1 of my testers.
atomhax commentedon Jul 10, 2023
I think this PR may fix the issue. Please review and let me know.