]> O.S.I.I.S - jp/crow.git/commitdiff
lock RenderMutex when loading, test lqi==null, list loading slowed down
authorjpbruyere <jp.bruyere@hotmail.com>
Wed, 2 Mar 2016 07:53:46 +0000 (08:53 +0100)
committerjpbruyere <jp.bruyere@hotmail.com>
Wed, 2 Mar 2016 07:53:46 +0000 (08:53 +0100)
src/Interface.cs

index 36ac681ded82abd848689d30b60ca12956e9b71e..826885941da91ecf811508c9b76cd8d74caa767c 100644 (file)
@@ -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;
                                }