vfont icon indicating copy to clipboard operation
vfont copied to clipboard

Crash when updating multiple axes

Open ssayfulin69 opened this issue 1 year ago • 0 comments

When the setValue(...) function is called multiple times one after another, the EXC_BAD_ACCESS error can occur on the second call, like in this example:

let vFont = VFont(name: "MyFont", size: 14)
vFont.setValue(value1, forAxisID: axis1)
vFont.setValue(value2, forAxisID: axis2) // EXC_BAD_ACCESS

I assume that it happens because the name of the font is changed during the first call, and the system can't find it when executing the second time. This situation seems to me like a race condition, even though all the code appears sync. The crash happens about 50% of the time.

At this moment of error the font name contains the attribute suffix:

(lldb) po variableFontName
"myFont_wght_wdth680000"
Screenshot 2024-11-04 at 5 39 38 PM

ssayfulin69 avatar Nov 04 '24 16:11 ssayfulin69