aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-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 }