]> O.S.I.I.S - jp/crow.git/commitdiff
lock layouting when image loading
authorJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 4 Jan 2017 00:09:54 +0000 (01:09 +0100)
committerJean-Philippe Bruyère <jp_bruyere@hotmail.com>
Wed, 4 Jan 2017 00:09:54 +0000 (01:09 +0100)
src/GraphicObjects/Image.cs

index 61b6e0593b90394e3c346f67bc9c00deecf26c97..fa036b97f4cdd770a40a6810a37144b4589e09d4 100644 (file)
@@ -50,9 +50,11 @@ namespace Crow
                                                _pic = null;
                                                return;
                                        }
-                                       LoadImage (value);
-                                       _pic.Scaled = scaled;
-                                       _pic.KeepProportions = keepProps;
+                                       lock(CurrentInterface.LayoutMutex){
+                                               LoadImage (value);
+                                               _pic.Scaled = scaled;
+                                               _pic.KeepProportions = keepProps;
+                                       }
                                } catch (Exception ex) {
                                        Debug.WriteLine (ex.Message);
                                        _pic = null;
@@ -86,7 +88,6 @@ namespace Crow
 
                        _pic.LoadImage (path);
                        RegisterForGraphicUpdate ();
-                       RegisterForLayouting (LayoutingType.Sizing);
                }
                #endregion