diff --git a/Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift b/Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift index 81b4d64..33c7eb8 100644 --- a/Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift +++ b/Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift @@ -160,10 +160,11 @@ public class PhaseLockedVocoder: Node { au.setWavetable(data: data, size: Int(ioNumberFrames)) } else { // failure - theData?.deallocate() - theData = nil // make sure to return NULL Log("Error = \(err)"); break Exit } + // Fixing a previous memory leak + theData?.deallocate() + theData = nil } } }