// deinitialize internal static void Deinitialize() { if (OpenAlContext != IntPtr.Zero) { SoundManager.StopAllSounds(true); SoundManager.UnuseAllSoundsBuffers(); Alc.alcMakeContextCurrent(IntPtr.Zero); Alc.alcDestroyContext(OpenAlContext); OpenAlContext = IntPtr.Zero; } if (OpenAlDevice != IntPtr.Zero) { Alc.alcCloseDevice(OpenAlDevice); OpenAlDevice = IntPtr.Zero; } }
/// <summary>Deinitializes audio.</summary> internal static void Deinitialize() { StopAllSounds(); UnloadAllBuffers(); if (OpenAlContext != IntPtr.Zero) { Alc.alcMakeContextCurrent(IntPtr.Zero); Alc.alcDestroyContext(OpenAlContext); OpenAlContext = IntPtr.Zero; } if (OpenAlDevice != IntPtr.Zero) { Alc.alcCloseDevice(OpenAlDevice); OpenAlDevice = IntPtr.Zero; } }
protected override void ShutdownLibrary() { if (thread != null) { needAbortThread = true; Thread.Sleep(50); thread.Abort(); } if (realChannels != null) { foreach (OpenALRealChannel realChannel in realChannels) { if (realChannel.alSource != 0) { Al.alDeleteSources(1, ref realChannel.alSource); realChannel.alSource = 0; } } } try { Alc.alcMakeContextCurrent(IntPtr.Zero); Alc.alcDestroyContext(alContext); Alc.alcCloseDevice(alDevice); } catch { } if (realChannels != null) { realChannels.Clear(); realChannels = null; } if (criticalSection != null) { criticalSection.Dispose(); criticalSection = null; } instance = null; }