aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/Scripting
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-09-28 01:50:21 +0100
committerJustin Clark-Casey (justincc)2012-09-28 01:50:21 +0100
commit3db10fdbefa94509d318b9574e5a96c9567d5377 (patch)
treedd11c8533880b55a4e6b42ad6f10225e55ca68a4 /OpenSim/Region/CoreModules/Scripting
parentAdd MaxPrimsUndo config setting to [Startup] section of OpenSim.ini. (diff)
downloadopensim-SC_OLD-3db10fdbefa94509d318b9574e5a96c9567d5377.zip
opensim-SC_OLD-3db10fdbefa94509d318b9574e5a96c9567d5377.tar.gz
opensim-SC_OLD-3db10fdbefa94509d318b9574e5a96c9567d5377.tar.bz2
opensim-SC_OLD-3db10fdbefa94509d318b9574e5a96c9567d5377.tar.xz
Lock GDI+ portion og VectorRenderModule.GetDrawStringSize() to prevent concurrent thread use provoking mono crashes.
Same rationale as commit 13690582.
Diffstat (limited to 'OpenSim/Region/CoreModules/Scripting')
-rw-r--r--OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs17
1 files changed, 11 insertions, 6 deletions
diff --git a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
index d82551e..b4e3d77 100644
--- a/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
+++ b/OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs
@@ -112,14 +112,19 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
112 public void GetDrawStringSize(string text, string fontName, int fontSize, 112 public void GetDrawStringSize(string text, string fontName, int fontSize,
113 out double xSize, out double ySize) 113 out double xSize, out double ySize)
114 { 114 {
115 using (Font myFont = new Font(fontName, fontSize)) 115 lock (this)
116 { 116 {
117 SizeF stringSize = new SizeF(); 117 using (Font myFont = new Font(fontName, fontSize))
118 lock (m_graph)
119 { 118 {
120 stringSize = m_graph.MeasureString(text, myFont); 119 SizeF stringSize = new SizeF();
121 xSize = stringSize.Width; 120
122 ySize = stringSize.Height; 121 // XXX: This lock may be unnecessary.
122 lock (m_graph)
123 {
124 stringSize = m_graph.MeasureString(text, myFont);
125 xSize = stringSize.Width;
126 ySize = stringSize.Height;
127 }
123 } 128 }
124 } 129 }
125 } 130 }