protected void Dispose(bool disposing) { lock (engine.gcSync) { if (!IsDisposed) { if (Disposing != null) { Disposing.Invoke(this, null); } // If this is disposed, stop leaking memory! if (!engine.IsDisposed) { FAudio.FACTSoundBank_Destroy(handle); } OnSoundBankDestroyed(); } } }
protected void Dispose(bool disposing) { lock (engine.gcSync) { if (!IsDisposed) { if (Disposing != null) { Disposing.Invoke(this, null); } // If this is disposed, stop leaking memory! if (!engine.IsDisposed) { engine.UnregisterSoundBank(handle); FAudio.FACTSoundBank_Destroy(handle); Marshal.FreeHGlobal(dspSettings.pMatrixCoefficients); } OnSoundBankDestroyed(); } } }