private void ReleaseUnmanagedResources() { using (var handle = _handle.Lock()) { if (handle.Value != IntPtr.Zero) { AudioPluginDissonanceNative.Dissonance_DestroyRnnoiseState(handle.Value); handle.Value = IntPtr.Zero; } } }
public void Reset() { using (var handle = _handle.Lock()) { Log.Debug("Resetting RnnoisePreprocessor"); if (handle.Value != IntPtr.Zero) { //Destroy it AudioPluginDissonanceNative.Dissonance_DestroyRnnoiseState(handle.Value); handle.Value = IntPtr.Zero; } //Create a new one handle.Value = AudioPluginDissonanceNative.Dissonance_CreateRnnoiseState(); } }