aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Console/ConsoleBase.cs
diff options
context:
space:
mode:
authorMelanie Thielker2009-02-07 15:51:00 +0000
committerMelanie Thielker2009-02-07 15:51:00 +0000
commite4ab15ccb1385c2ada97bc659845ea522268682e (patch)
tree5d4a784f424de8c843f08922561f64a7c9d85ad4 /OpenSim/Framework/Console/ConsoleBase.cs
parentthe parameters for llAtan2 were inverted before passing to Math. (diff)
downloadopensim-SC_OLD-e4ab15ccb1385c2ada97bc659845ea522268682e.zip
opensim-SC_OLD-e4ab15ccb1385c2ada97bc659845ea522268682e.tar.gz
opensim-SC_OLD-e4ab15ccb1385c2ada97bc659845ea522268682e.tar.bz2
opensim-SC_OLD-e4ab15ccb1385c2ada97bc659845ea522268682e.tar.xz
Fix a .NET issue where changing a locked reference would cause a crash
Diffstat (limited to 'OpenSim/Framework/Console/ConsoleBase.cs')
-rw-r--r--OpenSim/Framework/Console/ConsoleBase.cs24
1 files changed, 18 insertions, 6 deletions
diff --git a/OpenSim/Framework/Console/ConsoleBase.cs b/OpenSim/Framework/Console/ConsoleBase.cs
index f990748..380894d 100644
--- a/OpenSim/Framework/Console/ConsoleBase.cs
+++ b/OpenSim/Framework/Console/ConsoleBase.cs
@@ -703,8 +703,11 @@ namespace OpenSim.Framework.Console
703 System.Console.CursorLeft = 0; // Needed for mono 703 System.Console.CursorLeft = 0; // Needed for mono
704 System.Console.Write(" "); // Needed for mono 704 System.Console.Write(" "); // Needed for mono
705 705
706 y = System.Console.CursorTop; 706 lock (cmdline)
707 cmdline = new StringBuilder(); 707 {
708 y = System.Console.CursorTop;
709 cmdline.Remove(0, cmdline.Length);
710 }
708 711
709 while(true) 712 while(true)
710 { 713 {
@@ -754,7 +757,8 @@ namespace OpenSim.Framework.Console
754 break; 757 break;
755 historyLine--; 758 historyLine--;
756 LockOutput(); 759 LockOutput();
757 cmdline = new StringBuilder(history[historyLine]); 760 cmdline.Remove(0, cmdline.Length);
761 cmdline.Append(history[historyLine]);
758 cp = cmdline.Length; 762 cp = cmdline.Length;
759 UnlockOutput(); 763 UnlockOutput();
760 break; 764 break;
@@ -764,9 +768,14 @@ namespace OpenSim.Framework.Console
764 historyLine++; 768 historyLine++;
765 LockOutput(); 769 LockOutput();
766 if (historyLine == history.Count) 770 if (historyLine == history.Count)
767 cmdline = new StringBuilder(); 771 {
772 cmdline.Remove(0, cmdline.Length);
773 }
768 else 774 else
769 cmdline = new StringBuilder(history[historyLine]); 775 {
776 cmdline.Remove(0, cmdline.Length);
777 cmdline.Append(history[historyLine]);
778 }
770 cp = cmdline.Length; 779 cp = cmdline.Length;
771 UnlockOutput(); 780 UnlockOutput();
772 break; 781 break;
@@ -784,7 +793,10 @@ namespace OpenSim.Framework.Console
784 793
785 System.Console.WriteLine("{0}{1}", prompt, cmdline); 794 System.Console.WriteLine("{0}{1}", prompt, cmdline);
786 795
787 y = -1; 796 lock (cmdline)
797 {
798 y = -1;
799 }
788 800
789 if (isCommand) 801 if (isCommand)
790 { 802 {