[aquaria] I recommend to use this fix
grosser.meister.morti at gmx.net
Tue Apr 26 22:16:47 EDT 2011
Ok, now I have implemented a third version of a fix:
Now IngredientData instances are not copyable and there is one dedicated owner (the class
Continuity, holding the ingredients in ingredientData). I also did some cleanup on the FoodHolder
code (reduced redundancy of changes to amount and held etc., and use FoodHolder::discard() where its
code was duplicated).
I created 3 branches in my bitbucket repo for the 3 versions of the fix. Please pull the one you
think is the best. I think it should be panzi-non-copyable-ingredient-data.
The changes in panzi-non-copyable-ingredient-data are attached as a patch.
On 04/26/2011 07:03 PM, Andrew Church wrote:
>> So all IngrediantData* fields should be replaced with std::string fields?
> With respect to the food holders, yes. (I don't want to comment on other
> uses of IngredientData at the moment since I haven't checked them in
> detail.) Then you'd have a lookup call in each function that currently
> dereferences the stored pointer.
>> When I cook something else and then combine two leaves twice I couldn't reproduce the crash myself.
>> I guess I have found a certain inventory state that shows this behaviour by accident. I attached the
>> save state that causes the problem. Just immediately open the cooking menu and combine two leaves twice.
> Thanks! I confirmed the crash here -- it looks like the cause in this
> case is that the first action on the inventory is cooking a new item,
> which causes the push_back() call to expand (and thus reallocate) the
> inventory array.
> --Andrew Church
> achurch at achurch.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 24577 bytes
Desc: not available
More information about the aquaria