A DatabaseInterface (implementation) keeps a reference to the GameInterface (implementation) it was created for, so if the latter is destroyed, the former enters an invalid state, leading to undefined behaviour. I encountered this while trying to adapt the python wrapper with minimal breaking changes (I had a function that constructs a local game handle and returns its database).
The implementations should be refactored so that there is no storage of a Game object in the ApiDatabase object, or if an object is stored, it should be in a smart pointer.
A DatabaseInterface (implementation) keeps a reference to the GameInterface (implementation) it was created for, so if the latter is destroyed, the former enters an invalid state, leading to undefined behaviour. I encountered this while trying to adapt the python wrapper with minimal breaking changes (I had a function that constructs a local game handle and returns its database).
The implementations should be refactored so that there is no storage of a Game object in the ApiDatabase object, or if an object is stored, it should be in a smart pointer.