From: jpbruyere Date: Wed, 2 Mar 2016 07:53:46 +0000 (+0100) Subject: lock RenderMutex when loading, test lqi==null, list loading slowed down X-Git-Tag: v0.4~93^2~4 X-Git-Url: https://git.osiis.dedyn.io/?a=commitdiff_plain;h=b4e481513e4370c4324226c54f8cc730d65440b3;p=jp%2Fcrow.git lock RenderMutex when loading, test lqi==null, list loading slowed down --- diff --git a/src/Interface.cs b/src/Interface.cs index 36ac681d..82688594 100644 --- a/src/Interface.cs +++ b/src/Interface.cs @@ -205,9 +205,11 @@ namespace Crow public GraphicObject LoadInterface (string path) { - GraphicObject tmp = Interface.Load (path, this); - AddWidget (tmp); - return tmp; + lock (RenderMutex) { + GraphicObject tmp = Interface.Load (path, this); + AddWidget (tmp); + return tmp; + } } #endregion @@ -310,7 +312,8 @@ namespace Crow while (queueCount > 0) { lock (Interface.LayoutingQueue) lqi = Interface.LayoutingQueue.Dequeue (); - lqi.ProcessLayouting (); + if (lqi!=null) + lqi.ProcessLayouting (); lock (Interface.LayoutingQueue) queueCount = Interface.LayoutingQueue.Count; }