Still trying to debug crash on Mono. Reverted changes.

This commit is contained in:
the_fiddler 2008-01-20 22:35:46 +00:00
parent 9c0087e1bf
commit f3916e3357
3 changed files with 6 additions and 9 deletions

View file

@ -56,9 +56,9 @@ namespace Examples
context.IsCurrent = false; context.IsCurrent = false;
Trace.Assert(!context.IsCurrent); Trace.Assert(!context.IsCurrent);
//Trace.WriteLine("IsCurrent = true..."); Trace.WriteLine("IsCurrent = true...");
//context.IsCurrent = true; context.IsCurrent = true;
//Trace.Assert(context.IsCurrent); Trace.Assert(context.IsCurrent);
Trace.WriteLine("AudioContext.CurrentContext..."); Trace.WriteLine("AudioContext.CurrentContext...");
Trace.Assert(AudioContext.CurrentContext == context); Trace.Assert(AudioContext.CurrentContext == context);

View file

@ -114,7 +114,6 @@ namespace OpenTK.OpenAL
/// <param name="context">A pointer to the new context.</param> /// <param name="context">A pointer to the new context.</param>
/// <returns>Returns True on success, or False on failure.</returns> /// <returns>Returns True on success, or False on failure.</returns>
[DllImport(Alc.Lib,EntryPoint = "alcMakeContextCurrent",ExactSpelling = true,CallingConvention = Alc.Style),SuppressUnmanagedCodeSecurity( )] [DllImport(Alc.Lib,EntryPoint = "alcMakeContextCurrent",ExactSpelling = true,CallingConvention = Alc.Style),SuppressUnmanagedCodeSecurity( )]
[return: MarshalAs(UnmanagedType.I1)]
public static extern bool MakeContextCurrent( [In] IntPtr context ); public static extern bool MakeContextCurrent( [In] IntPtr context );
// ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context ); // ALC_API ALCboolean ALC_APIENTRY alcMakeContextCurrent( ALCcontext *context );

View file

@ -278,13 +278,11 @@ namespace OpenTK.Audio
/// </exception> /// </exception>
static void MakeCurrent(AudioContext context) static void MakeCurrent(AudioContext context)
{ {
lock (audio_context_lock) //lock (audio_context_lock)
{ {
//if (context != null && context.disposed)
// throw new ObjectDisposedException("OpenTK.Audio.AudioContext");
if (!Alc.MakeContextCurrent(context != null ? (IntPtr)context.context_handle : IntPtr.Zero)) if (!Alc.MakeContextCurrent(context != null ? (IntPtr)context.context_handle : IntPtr.Zero))
throw new AudioContextException( throw new AudioContextException(Alc.GetError(
Alc.GetError(context != null ? (IntPtr)context.context_handle : IntPtr.Zero).ToString()); context != null ? (IntPtr)context.context_handle : IntPtr.Zero).ToString());
} }
} }