Merge pull request #186 from thefiddler/al_notfound_fix
[AL] Fix runtime crash when OpenAL not available
This commit is contained in:
commit
9a37b72002
1 changed files with 16 additions and 6 deletions
|
@ -204,6 +204,10 @@ namespace OpenTK.Audio
|
||||||
{
|
{
|
||||||
Debug.Unindent();
|
Debug.Unindent();
|
||||||
|
|
||||||
|
if (openal_supported)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
// clean up the dummy context
|
// clean up the dummy context
|
||||||
Alc.MakeContextCurrent(ContextHandle.Zero);
|
Alc.MakeContextCurrent(ContextHandle.Zero);
|
||||||
if (dummy_context != ContextHandle.Zero && dummy_context.Handle != IntPtr.Zero)
|
if (dummy_context != ContextHandle.Zero && dummy_context.Handle != IntPtr.Zero)
|
||||||
|
@ -211,6 +215,12 @@ namespace OpenTK.Audio
|
||||||
if (dummy_device != IntPtr.Zero)
|
if (dummy_device != IntPtr.Zero)
|
||||||
Alc.CloseDevice(dummy_device);
|
Alc.CloseDevice(dummy_device);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
openal_supported = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
Loading…
Reference in a new issue