Use more locking to improve thread-safety in Sheet.

This commit is contained in:
RoosterDragon
2014-11-22 17:56:19 +00:00
parent c2b7d9ca5b
commit c2d86557f1

View File

@@ -72,6 +72,8 @@ namespace OpenRA.Graphics
}
void GenerateTexture()
{
lock (textureLock)
{
if (texture == null)
{
@@ -81,8 +83,7 @@ namespace OpenRA.Graphics
if (data != null)
{
lock (textureLock)
{
if (dirty)
{
texture.SetData(data, Size.Width, Size.Height);
@@ -139,6 +140,8 @@ namespace OpenRA.Graphics
}
public void CreateBuffer()
{
lock (textureLock)
{
if (data != null)
return;
@@ -148,6 +151,7 @@ namespace OpenRA.Graphics
data = texture.GetData();
releaseBufferOnCommit = false;
}
}
public void CommitData()
{