I noticed this as well. I think this is due to a circular reference between the audio unit and the AudioUnitBusArray instances which hold a reference to the audio unit. I changed my code to always return a new instance of AudioUnitBusArray:
override public var inputBusses: AUAudioUnitBusArray { .init(audioUnit: self, busType: .input, busses: [inputBus]) }
override public var outputtBusses: AUAudioUnitBusArray { .init(audioUnit: self, busType: .output, busses: [outputBus]) }
Also, make sure you use [weak self] for your parameter tree blocks, and any other similar blocks:
parameters.parameterTree.implementorValueProvider = { [weak self] param in
self?.kernel.get(param) ?? AUValue(0)
}
parameters.parameterTree.implementorValueObserver = { [weak self] param, value in
self?.kernel.set(param, value: value)
}
I have test cases that make sure I get an AUValue(0) from the parameter tree after nulling out a reference to my audio unit.