xaya / libxayagame

MIT License
21 stars 20 forks source link

Correctly reference metadata in ParsedBoardState #74

Closed domob1812 closed 5 years ago

domob1812 commented 5 years ago

ParsedBoardState's (with this change, previously just ProtoBoardState's) contain a reference to a ChannelMetadata proto. This reference comes from BoardRules::ParseState, and is must be valid as long as the ParsedBoardState instance is alive.

This assumption was violated previously in RollingBoardState, because we used a temporary metadata instance rather than the copy stored in a reinit entry for parsing the states. With this change, we fix this, so that no bad references are used.