Fix the test and fix the crash
To fix the issue, I introduced a test whether the game logic object has created single games (by trying to access one). Only if the game logic object has single games, stop game and delete single games is called. I have also confirmed by manual testing that the game no longer crashes when (re)starting a game after the first one. The test is not as unit-test-y as I would like: Several QWARN are issued. Furthermore, there is another option to improve usability: The last piece is also placed ontop of an existing piece, triggering a game over. However, this final piece is still invisible.
parent
a3e9b5fe
Please register or sign in to comment