Another attempt to fix the "Destination array was not long enough" errors in AddToGUIUpdateList:
The errors seem to be caused by adding messages to the debug console from another thread, which may happen if an OpenAL error occurs during sound streaming. Now the debug console queues the messages and creates the necessary UI elements in the main thread, which should(?) make it thread-safe. (TODO: figure out what's causing the OpenAL errors)
This commit is contained in:
@@ -51,10 +51,9 @@ namespace Barotrauma.Sounds
|
||||
if ((error = AL.GetError()) != ALError.NoError)
|
||||
{
|
||||
#if DEBUG
|
||||
DebugConsole.ThrowError("OpenAL error: " + AL.GetErrorString(error));
|
||||
DebugConsole.ThrowError("OpenAL error: " + AL.GetErrorString(error) + "\n" + Environment.StackTrace);
|
||||
#else
|
||||
|
||||
DebugConsole.NewMessage("OpenAL error: " + AL.GetErrorString(error), Microsoft.Xna.Framework.Color.Red);
|
||||
DebugConsole.NewMessage("OpenAL error: " + AL.GetErrorString(error) + "\n" + Environment.StackTrace, Microsoft.Xna.Framework.Color.Red);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user