Fix a .NET issue where changing a locked reference would cause a crash

0.6.3-post-fixes
Melanie Thielker 2009-02-07 15:51:00 +00:00
parent 6bd2979486
commit e4ab15ccb1
1 changed files with 18 additions and 6 deletions

View File

@ -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
lock (cmdline)
{
y = System.Console.CursorTop; y = System.Console.CursorTop;
cmdline = new StringBuilder(); 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);
lock (cmdline)
{
y = -1; y = -1;
}
if (isCommand) if (isCommand)
{ {