Skip to content

Commit 003b954

Browse files
committed
Moved the deallocation of theData to the end
1 parent 90a131b commit 003b954

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

Sources/SoundpipeAudioKit/Generators/PhaseLockedVocoder.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ public class PhaseLockedVocoder: Node {
158158
bufferList.mBuffers.mData?.assumingMemoryBound(to: Float.self)
159159
)
160160
au.setWavetable(data: data, size: Int(ioNumberFrames))
161-
// Fixing a previous memory leak
162-
theData?.deallocate()
163-
theData = nil
164161
} else {
165162
// failure
166163
theData?.deallocate()
167164
theData = nil // make sure to return NULL
168165
Log("Error = \(err)"); break Exit
169166
}
167+
// Fixing a previous memory leak
168+
theData?.deallocate()
169+
theData = nil
170170
}
171171
}
172172
}

0 commit comments

Comments
 (0)