Use more locking to improve thread-safety in Sheet.
This commit is contained in:
@@ -72,6 +72,8 @@ namespace OpenRA.Graphics
|
|||||||
}
|
}
|
||||||
|
|
||||||
void GenerateTexture()
|
void GenerateTexture()
|
||||||
|
{
|
||||||
|
lock (textureLock)
|
||||||
{
|
{
|
||||||
if (texture == null)
|
if (texture == null)
|
||||||
{
|
{
|
||||||
@@ -81,8 +83,7 @@ namespace OpenRA.Graphics
|
|||||||
|
|
||||||
if (data != null)
|
if (data != null)
|
||||||
{
|
{
|
||||||
lock (textureLock)
|
|
||||||
{
|
|
||||||
if (dirty)
|
if (dirty)
|
||||||
{
|
{
|
||||||
texture.SetData(data, Size.Width, Size.Height);
|
texture.SetData(data, Size.Width, Size.Height);
|
||||||
@@ -139,6 +140,8 @@ namespace OpenRA.Graphics
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void CreateBuffer()
|
public void CreateBuffer()
|
||||||
|
{
|
||||||
|
lock (textureLock)
|
||||||
{
|
{
|
||||||
if (data != null)
|
if (data != null)
|
||||||
return;
|
return;
|
||||||
@@ -148,6 +151,7 @@ namespace OpenRA.Graphics
|
|||||||
data = texture.GetData();
|
data = texture.GetData();
|
||||||
releaseBufferOnCommit = false;
|
releaseBufferOnCommit = false;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public void CommitData()
|
public void CommitData()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user