diff options
author | Justin Clark-Casey (justincc) | 2012-09-28 01:50:21 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-09-28 01:50:21 +0100 |
commit | 3db10fdbefa94509d318b9574e5a96c9567d5377 (patch) | |
tree | dd11c8533880b55a4e6b42ad6f10225e55ca68a4 /OpenSim | |
parent | Add MaxPrimsUndo config setting to [Startup] section of OpenSim.ini. (diff) | |
download | opensim-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')
-rw-r--r-- | OpenSim/Region/CoreModules/Scripting/VectorRender/VectorRenderModule.cs | 17 |
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 | } |