Use more locking to improve thread-safety in Sheet.
This commit is contained in:
@@ -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()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user