better null check (#3036)

This commit is contained in:
Zach H 2018-01-20 14:54:34 -05:00 committed by GitHub
parent 55029b6b68
commit 261d3ac591
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 29 additions and 11 deletions

View file

@ -434,12 +434,14 @@ void TabGame::emitUserEvent() {
TabGame::~TabGame()
{
if(replay)
delete replay;
delete replay;
QMapIterator<int, Player *> i(players);
while (i.hasNext())
{
delete i.next().value();
}
players.clear();
emit gameClosing(this);