Changeset - 78ecf5feebe4
[Not reviewed]
default
0 2 0
Jason Maltzen - 8 years ago 2015-12-23 23:52:36
jason@hiddenachievement.com
Fix a crash with potential multi-threaded access to paint recipes.
2 files changed with 17 insertions and 1 deletions:
0 comments (0 inline, 0 general)
PaintRecipe.cs
Show inline comments
...
 
@@ -58,6 +58,21 @@ namespace DesertPaintLab
 
        {
 
        }
 

	
 
        public PaintRecipe(PaintRecipe other)
 
        {
 
            this.dirty = true;
 
            this.reactions = other.reactions;
 
            foreach (string reagentName in other.reagents)
 
            {
 
                this.reagents.Add(reagentName);
 
            }
 
            foreach (RecipeIngredient copyIngredient in other.recipe)
 
            {
 
                RecipeIngredient ingredient = new RecipeIngredient(copyIngredient.name, copyIngredient.quantity);
 
                this.recipe.Add(ingredient);
 
            }
 
        }
 

	
 
        public List<RecipeIngredient> Ingredients
 
        {
 
            get {
RecipeGeneratorWindow.cs
Show inline comments
...
 
@@ -200,6 +200,7 @@ namespace DesertPaintLab
 

	
 
        protected void OnNewRecipe(object sender, NewRecipeEventArgs args)
 
        {
 
            PaintRecipe recipe = new PaintRecipe(args.Recipe); // copy it
 
            Gtk.Application.Invoke(delegate
 
            {
 
                progressBar.Pulse();
...
 
@@ -226,7 +227,7 @@ namespace DesertPaintLab
 
                    colorStore.AppendValues(args.Color); // , missingReactionLabel);
 
                    countLabel.Text = String.Format("{0} / {1}", generator.Recipes.Count, Palette.Count);
 
                }
 
                profile.SetRecipe(args.Recipe);
 
                profile.SetRecipe(recipe);
 
            });
 
        }
 

	
0 comments (0 inline, 0 general)