[aquaria] crash :/

Andrew Church achurch+aquaria at achurch.org
Wed Apr 27 00:41:21 EDT 2011


>I think I know what causes the crash and I found a comment of yours about this in Aquaria/Game.cpp 
>in Game::onCook:
>
>// FIXME: It _looks_ like *ing should be the actual inventory
>// object, but playing it safe because I'm not sure.  --achurch

Yeah, I rather suspected the problem was around there -- the pointer
usage looked a bit suspicious to me, but it seemed to work as far as I
went.  That said, it would probably by simpler to just avoid taking
pointers in the first place, rather than introducing the additional
complexity of smart pointers.  ISTM it would make more sense to have
the food holders store only the item name and look that up as necessary,
since menu processing isn't on the critical path.

Out of curiosity, what was your inventory when you reproduced the crash?
(I tried clicking Cook twice with two leaves, as you suggested, but I
didn't see any crash, and Valgrind didn't report any invalid accesses.)

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/


More information about the aquaria mailing list