Lock GDI+ portion og VectorRenderModule.GetDrawStringSize() to prevent concurrent thread use provoking mono crashes.
Same rationale as commit 13690582
.
0.7.4-post-fixes
parent
c27a158961
commit
bbe04aab95
|
@ -98,14 +98,19 @@ namespace OpenSim.Region.CoreModules.Scripting.VectorRender
|
||||||
public void GetDrawStringSize(string text, string fontName, int fontSize,
|
public void GetDrawStringSize(string text, string fontName, int fontSize,
|
||||||
out double xSize, out double ySize)
|
out double xSize, out double ySize)
|
||||||
{
|
{
|
||||||
using (Font myFont = new Font(fontName, fontSize))
|
lock (this)
|
||||||
{
|
{
|
||||||
SizeF stringSize = new SizeF();
|
using (Font myFont = new Font(fontName, fontSize))
|
||||||
lock (m_graph)
|
|
||||||
{
|
{
|
||||||
stringSize = m_graph.MeasureString(text, myFont);
|
SizeF stringSize = new SizeF();
|
||||||
xSize = stringSize.Width;
|
|
||||||
ySize = stringSize.Height;
|
// XXX: This lock may be unnecessary.
|
||||||
|
lock (m_graph)
|
||||||
|
{
|
||||||
|
stringSize = m_graph.MeasureString(text, myFont);
|
||||||
|
xSize = stringSize.Width;
|
||||||
|
ySize = stringSize.Height;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue