Fix a .NET issue where changing a locked reference would cause a crash
parent
6bd2979486
commit
e4ab15ccb1
|
@ -703,8 +703,11 @@ namespace OpenSim.Framework.Console
|
||||||
System.Console.CursorLeft = 0; // Needed for mono
|
System.Console.CursorLeft = 0; // Needed for mono
|
||||||
System.Console.Write(" "); // Needed for mono
|
System.Console.Write(" "); // Needed for mono
|
||||||
|
|
||||||
y = System.Console.CursorTop;
|
lock (cmdline)
|
||||||
cmdline = new StringBuilder();
|
{
|
||||||
|
y = System.Console.CursorTop;
|
||||||
|
cmdline.Remove(0, cmdline.Length);
|
||||||
|
}
|
||||||
|
|
||||||
while(true)
|
while(true)
|
||||||
{
|
{
|
||||||
|
@ -754,7 +757,8 @@ namespace OpenSim.Framework.Console
|
||||||
break;
|
break;
|
||||||
historyLine--;
|
historyLine--;
|
||||||
LockOutput();
|
LockOutput();
|
||||||
cmdline = new StringBuilder(history[historyLine]);
|
cmdline.Remove(0, cmdline.Length);
|
||||||
|
cmdline.Append(history[historyLine]);
|
||||||
cp = cmdline.Length;
|
cp = cmdline.Length;
|
||||||
UnlockOutput();
|
UnlockOutput();
|
||||||
break;
|
break;
|
||||||
|
@ -764,9 +768,14 @@ namespace OpenSim.Framework.Console
|
||||||
historyLine++;
|
historyLine++;
|
||||||
LockOutput();
|
LockOutput();
|
||||||
if (historyLine == history.Count)
|
if (historyLine == history.Count)
|
||||||
cmdline = new StringBuilder();
|
{
|
||||||
|
cmdline.Remove(0, cmdline.Length);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
cmdline = new StringBuilder(history[historyLine]);
|
{
|
||||||
|
cmdline.Remove(0, cmdline.Length);
|
||||||
|
cmdline.Append(history[historyLine]);
|
||||||
|
}
|
||||||
cp = cmdline.Length;
|
cp = cmdline.Length;
|
||||||
UnlockOutput();
|
UnlockOutput();
|
||||||
break;
|
break;
|
||||||
|
@ -784,7 +793,10 @@ namespace OpenSim.Framework.Console
|
||||||
|
|
||||||
System.Console.WriteLine("{0}{1}", prompt, cmdline);
|
System.Console.WriteLine("{0}{1}", prompt, cmdline);
|
||||||
|
|
||||||
y = -1;
|
lock (cmdline)
|
||||||
|
{
|
||||||
|
y = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if (isCommand)
|
if (isCommand)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue