Example #1
0
        protected override void PlatformDispose()
        {
            mutex.WaitOne();
            if (usingResource == 1)
            {
                if (_context != IntPtr.Zero)
                {
                    AlNative.alcSuspendContext(_context);
                    checkAlcError();
                }
                AlNative.alcMakeContextCurrent(IntPtr.Zero);
                checkAlcError();

                if (_context != IntPtr.Zero)
                {
                    AlNative.alcDestroyContext(_context);
                    checkAlcError();
                    _context = IntPtr.Zero;
                    AlNative.alcCloseDevice(_device);
                    checkAlcError();
                    _device = IntPtr.Zero;
                }
                usingResource = 0;
            }
            mutex.ReleaseMutex();
        }
Example #2
0
 protected override void PlatformDispose()
 {
     AlNative.alcMakeContextCurrent((IntPtr)0);
     checkAlcError();
     AlNative.alcDestroyContext(_context);
     checkAlcError();
     AlNative.alcCloseDevice(_device);
     checkAlcError();
 }
Example #3
0
 protected override void PlatformDispose()
 {
     AlNative.alcDestroyContext(_context);
     AlNative.alcCloseDevice(_device);
 }